uiwebview

How does iOS 6 UIWebView state restoration work?

会有一股神秘感。 提交于 2019-12-18 11:35:45
问题 According the docs: In iOS 6 and later, if you assign a value to this view’s restorationIdentifier property, it attempts to preserve its URL history, the scaling and scrolling positions for each page, and information about which page is currently being viewed. During restoration, the view restores these values so that the web content appears just as it did before. I'm doing all that, but nothing is happening. And even if I manually save and restore the URL the user was looking at previously,

UIWebview won't zoom even after setting scalesPageToFit to YES

你离开我真会死。 提交于 2019-12-18 11:33:33
问题 I have a UIWebview that is loaded as a subview when a user selects a tab on a UISegmentedControl . For some reason, I can not get it to allow pinch/zooming . I set the following code in the viewDidLoad: method, so it should work. self.myWebView = [[[UIWebView alloc] initWithFrame:self.view.frame] autorelease]; self.myWebView.backgroundColor = [UIColor whiteColor]; self.myWebView.scalesPageToFit = YES; self.myWebView.autoresizingMask = (UIViewAutoresizingFlexibleWidth |

How to refresh a UIWebView by a “pull down and release” gesture?

给你一囗甜甜゛ 提交于 2019-12-18 10:56:41
问题 I know that this is possible in the Tweetie for iPhone or the xkcd iPhone app, but they are using a table. Any idea if this can be done for a simple UIWebView as well? I'm aware of the Javascript suggestions in this SO question, but what about making that natively? 回答1: FYI, iOS 5 has officially introduced the property scrollView in UIWebView. I tested it. It worked perfectly with EGO's pull and refresh code. So the problem is no longer a problem for any iOS 5 devices. For downward

Freeing iOS UIWebView resources after usage

允我心安 提交于 2019-12-18 10:41:47
问题 Our app's home screen (and therefore the first seen by all users) has several sections, most of which contain diferent webviews the user may want to open. Doing so increases memory usage from barely 26MB to up to 85MB or even more (after opening all diferent webviews). The problem we found is that, once they're closed, all web page resources seem to be kept at memory (used memory barely decreases a couple of MB perhaps). I would like to free the resources the webview had to open because,

iOS access to Safari Reader feature through UIWebView

六眼飞鱼酱① 提交于 2019-12-18 10:24:58
问题 I am using iOS 4.3 & was wondering if there is any way that I can access the Safari's "Reader" feature through which webpages are removed of ads & other riff raff & the content takes the center stage. If one opens any article in Safari (on say Wikipedia website), then a "Reader" button appears on the URL bar. Clicking on it presents a new window presenting the content beautifully. How can I leverage this this functionality in iOS through UIWebView ? PS: I know there is something called

iPhone - Auto resizing UIWebView content do not fit the frame

故事扮演 提交于 2019-12-18 10:23:06
问题 I'm generating an UIWebView into my viewDidLoad method, with a tiny size (let's say something like 50x70). And then I put it into a super UIView. I'd like to make its content fit the webView frame. To do this, I wrote : oneView = [[UIWebView alloc] initWithFrame:CGRectMake(x, y, W, H)]; oneView.backgroundColor = [UIColor whiteColor]; oneView.autoresizingMask = UIViewAutoresizingFlexibleWidth; oneView.scalesPageToFit = YES; oneView.autoresizesSubviews = YES; [self.view addSubview:oneView];

How to give page curl animation in webView?

眉间皱痕 提交于 2019-12-18 09:50:15
问题 I am working on PDF Reader application. if i display pdf file then i am not able to change font size of this. So i display ePub file in UIWebView. But my problem is how to add page curl animation in UIWebView like iBook and kindle apps does. 回答1: I have created a UIWebView named myWebView and on clicking the button the curl effect will be shown on the webview:- -(IBAction) nextPageAnimationForWebView{ CATransition *animation = [CATransition animation]; [animation setDelegate:self]; [animation

How to load a url link that is inside a web view and keep it in that web view in SWIFT

不打扰是莪最后的温柔 提交于 2019-12-18 09:40:05
问题 I have a web view that has a webpage with links at the bottom. I have a way to deal with them being clicked, but all it does is open them into a new safari browser. This is not what I want.I would like for them to stay inside the web view and allow me to navigate them easily like that. Is there a way to do this? I have tried just using a regular web view, but then the links at the bottom will not work. Here is what I have so far: class ViewController: UIViewController, UIWebViewDelegate {

NSMutableURLRequest timeout doesn't trigger if data starts to load but not webViewDidFinishLoad

落花浮王杯 提交于 2019-12-18 09:12:39
问题 I am loading a UIWebview and requesting a URL that can take some time to finish loading. The request starts and begins to receive data. However, it doesn't appear that the request finishes. The webViewDidFinishLoad never triggers nor does the webView didFailLoadWithError: callback. Does a timeout of a NSURLRequest only occur if there is no response receiving data or does it trigger if the request doesn't complete in that interval as well? If it's the former, is there an elegant solution to

Has iOS 7 changed PNG compatibility/handling?

随声附和 提交于 2019-12-18 08:39:13
问题 I've got an app that uses a UIWebView , and everything was (and still is) working perfectly on iOS 6. On iOS 7, though, it is sometimes kicking back an error ImageIO: PNG not a PNG file when I try to load certain PNG files, (for example this one). Now, obviously the PNG files aren't corrupted because they work on iOS 6 and they sometimes work even on iOS 7, but then sometimes they kick back that error. I can't find any common cause that determines when the error happens, and I'm not doing