uiwebview

How to get fast, smooth scrolling with UIWebView?

流过昼夜 提交于 2019-12-13 17:30:19
问题 UIWebView exhibits jerky behavior when scrolling fast through lots of content. Mobile Safari, on the other hand, scrolls quickly and smoothly. It displays a simple checkerboard pattern while scrolling and then renders the page when scrolling is done. How can we get Mobile Safari's fast, smooth scrolling behavior with a UIWebView? 回答1: Would this help? Found a better solution. CGTiledLayer. 来源: https://stackoverflow.com/questions/2987132/how-to-get-fast-smooth-scrolling-with-uiwebview

UIWebView horizontal bounce not working

心已入冬 提交于 2019-12-13 16:35:52
问题 I am trying to get my UIWebView to bounce Horizontally, it already bounces vertically but its just not doing the Horizontal bounce. I add the UIWebView like this // pass data off to the correct view to be used lpViewController = [[LPViewController alloc] init]; lpViewController.view.frame = CGRectMake(0.0, infoBarHeight, lpViewController.view.bounds.size.width, lpViewController.view.bounds.size.height); lpViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth |

Make a Flip animation (or something similar) when I reload the content of my UIWebView

萝らか妹 提交于 2019-12-13 15:46:32
问题 In one of my project i'm using only a UIWebView. I need an animation (for example a flip) when I reload my webView with another content... Is it possible to create a flip animation (or something similar)? I must create a fake controller to get it? Solutions? Thanks 回答1: I think that you don't need to create a controller for that. You can simply add something like that: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.80]; [UIView setAnimationTransition

form's onsubmit with UIWebView

时光怂恿深爱的人放手 提交于 2019-12-13 15:26:51
问题 I have this form: <form id="form1" name="form1" method="post" action="#" onsubmit="window.open('http://www.google.com','Google','width=800,height=500,top=5000,left=6000,status=yes,resizable=yes,scrollbars=yes');"> <input type="submit" name="submit" onclick="doSubmit();" id="submit" value="Submit" /> </form> And the javascript that belongs to it is: <script type="text/javascript"> function doSubmit () { form1.submit(); } </script> When I test it in the native safari app all goes well and the

Swift & UIWebView element to hide

半腔热情 提交于 2019-12-13 15:26:39
问题 I got a UIWebView and I load the content like that let url = NSURL (string: "http://www.myresponsivesite.fr/section/"); let requestObj = NSURLRequest(URL: url!); webView.loadRequest(requestObj); It's working perfectly but I would like to put some div and other elements in display none. So my question is : How can I inject some css from my app with swift? Thanks. 回答1: I finally found another way, I load my html in a variable and, i replace some div with a "display:none" exemple : let urlDeBase

Displaying a PDF with UIWebView Not Working

五迷三道 提交于 2019-12-13 15:23:37
问题 So, I realize that there have been many questions regarding using a UIWebView to display a PDF in an app (on the iPad). I have reviewed everything I can find but I can't seem to find any satisfaction. What I'm trying to do is very basic so I really don't know why it's not working. All I need to do is display a locally stored PDF in the UIWebView. Essentially, all I'm getting is a black screen. If someone could take a look at my code, I'd really appreciate it. Thanks. - (void) prepareForSegue:

How to remove HTML5 persistant databases in UIWebView?

心已入冬 提交于 2019-12-13 14:36:50
问题 I have a native application that uses a UIWebView and notice that with sites like Google, they are using an HTML5 local database for storing information. I am using native APIs for clearing items out of the cookie store, but clearing the persistent cookie store does nothing to remove these local databases. Is there a way to remove them through a native API? UPDATE: Is there a way to do this through a non-native API or javascript? 回答1: You can run this JavaScript directly in your url bar:

User-Agent not changing in NSMutableURLRequest

痴心易碎 提交于 2019-12-13 12:29:09
问题 I know there may be several issues about this, but i´m facing a problem when i try to set a new "user agent" for my UIWebView . Here is what i am doing right now: NSURL *myUrl = [NSURL URLWithString:auxUrl]; NSMutableURLRequest *myRequest = [NSMutableURLRequest requestWithURL:myUrl]; NSMutableString *auxUserAgent = [[NSMutableString alloc] initWithString:[myRequest valueForHTTPHeaderField: @"User-Agent"]]; [auxUserAgent appendString:@"(iOS)"]; [myRequest setValue:auxUserAgent

Play local video file in UIwebview [closed]

≯℡__Kan透↙ 提交于 2019-12-13 10:42:06
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . I can't play local video file in UIWebview. Here is my code anything wrong? or Apple can't allow to play local video file in UIWebview. NSString *webViewString = [NSString stringWithFormat:@"<!doctypehtml><html><head><title>SimpleMoviePlayer</title></head><body><videosrc=\"%@\">controls autoplay

How to open external link from UIWebView not in my App, but in Safari? SWIFT

点点圈 提交于 2019-12-13 09:10:30
问题 I would like to open all external links which are in my application ( UIWebView ) not inside the app, but in Safari. How can I do that? I have implement UiWebViewDelegate. Working solution for my question bellow: func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool { if navigationType == UIWebViewNavigationType.LinkClicked{ UIApplication.sharedApplication().openURL(request.URL!) return false } return true } 回答1: