uiwebview

What works to pass touches through to (and display all) subviews?

无人久伴 提交于 2019-12-03 13:11:36
问题 I have the following subview chain: UIViewController.view -+ |-> UIView (subclass) -+ | +-> UIToolbar | +------------------------> UIWebView In the subclass, I override its -touchesEnded:forEvent: method in order to hide and show the UIToolbar on a single tap touch, through a CAAnimation , as well as issue an NSNotification that causes the view controller to hide its navigation bar. If I do not add the UIWebView as a subview to the view controller's view, then this works properly. If I then

Deferring viewWillAppear until webViewDidFinishLoad

那年仲夏 提交于 2019-12-03 13:05:19
I have an application that uses UIWebViews in several view controllers. The UIWebViews are used to render locally generated html, no slow network access required. To save memory I only load these on demand as prompted by the viewcontroller viewWillAppear callback. (And unload offscreen instances in response to didReceiveMemoryWarning messages.) The problem is that the user gets to see the html being rendered, sometimes accompanied by flashes of styling and other assorted unpleasant artifacts. I would much rather the rendering be done offscreen, and reveal the fully rendered view when its ready

Accessing UIWebView local storage data from native iPhone app

自古美人都是妖i 提交于 2019-12-03 13:01:43
I'm writing a native iPhone app that contains a UIWebView component. This component accesses an internet webapp and the webapp stores data offline using HTML5 local storage. Is it possible to access this local storage data from the native app ? I was looking to do something similar to this. In short, the DOM and all elements are not directly accessible. However, you can hack things up to get at the data. What you have to do is inject your own javascript into the downloaded webpage. Then evaluate the results. This page shows the mechanism for doing it: http://iphoneincubator.com/blog/windows

What File Types are Supported by WKWebView?

扶醉桌前 提交于 2019-12-03 12:59:48
UIWebView supports a whole list of file types, as detailed in this Apple Technical Q&A doc : In addition to HTML content, UIWebView can display specific document types. iPhone OS 2.2.1 supports the following document types: Excel (.xls) Keynote (.key.zip) Numbers (.numbers.zip) Pages (.pages.zip) PDF (.pdf) Powerpoint (.ppt) Word (.doc) iPhone OS 3.0 supports these additional document types: Rich Text Format (.rtf) Rich Text Format Directory (.rtfd.zip) Keynote '09 (.key) Numbers '09 (.numbers) Pages '09 (.pages) Which is great. These days however they generally advise that developers use

Docx support in UIWebview(iOS)?

只愿长相守 提交于 2019-12-03 12:57:48
问题 I have checked the official links for doc support, and it's clear that docx is not supported in UIWebview, https://developer.apple.com/library/archive/qa/qa1630/_index.html But, I also found out that some guys were able to open docx files in UIWebview, Cannot open docx file through webbrowser in app using OpenIn functionality, Why doc and docx losing style information in iOS?, How to open Microsoft Office documents in iPhone Also, afaik, iOS safari browser is built upon UIWebview and I am

High Resolution images in a uiwebview

扶醉桌前 提交于 2019-12-03 12:55:48
问题 I have a webview that displays an image, as shown in the code below. The bundle also has a DGT64@2x.png with dimensions of 128x128 for use on the iPhone4. The DGT64@2x.png never shows. Is there a way to display either/or depending on whether it's an iPhone or an iPhone4? <img src="DGT64.png" width="64" height="64" align="left" style="padding:2px;"/> 回答1: I don't think the @2x trick works with web content. Sounds really useful though, I would certainly file a bug with Apple to request that. If

clearing a webviews cache for local files

守給你的承諾、 提交于 2019-12-03 12:46:55
I've found some similar posts, but they don't seem to have any effect with what I'm doing. I've got a UIWebView that I'm using to display local content in my bundle. Specifically I'm displaying a docx file. The user should rarely ever look at this document, and my app is tight on memory, so what I want to do is prevent the UIWebView from caching the document. Another viable option is to clear the cache when the user leaves the view. I'm totally ok with having to load it from scratch every time the user enters the view. I load the document like so: NSString * path = [[NSBundle mainBundle]

UIWebView not freeing all live bytes using ARC

北城以北 提交于 2019-12-03 12:39:25
I am currently building a navigation controller app in iOS 5.1 that uses ARC. I often need to display webpages and I have made a web viewer that is just a UIWebView with some custom content around the sides. When the user is finished looking at the page they hit the back button which should release all of the memory associated with the custom web viewer. My problem is that all of the memory does not appear to be released when the back button is hit. I have built a toy app ( on github ) that is just a couple of buttons each having a first responder that calls a different page. @implementation

How to break up HTML documents into pages for ebook?

久未见 提交于 2019-12-03 12:32:34
问题 For an iPhone ebook application I need to break arbitrarily long HTML documents up into pages which fit exactly on one screen. If I simply use UIWebView for this, the bottom-most lines tend to get displayed only partly: the rest disappears off the edge of the view. So I assume I would need to know how many complete lines (or characters) would be displayed by the UIWebView, given the source HTML, and then feed it exactly the right amount of data. This probably involves lots of calculation, and

iPhone: Performances Differences Between NSURLRequestCachePolicy Settings

ぐ巨炮叔叔 提交于 2019-12-03 12:27:25
When using NSURLRequest on the iPhone, what are the real world performance differences between the various NSURLRequestCachePolicy settings? I am specifically interested in the cache policy's effect on the the user's perception of the speed at which UIWebView pages display. I have been using the default NSURLRequestCachePolicy but I think that perhaps NSURLRequestReloadRevalidatingCacheData could be best for most cases especially when going back to a previous page. If you've used various cache policies under real-world conditions, which policy proved optimum in a particular circumstance? What