uiwebview

Is it possible to cache web pages with a UIWebView?

Deadly 提交于 2019-12-11 16:58:54
问题 I have an app that contains a UIWebView. I would like the user to be able to view webpages they've previously navigated to when off line. How should I go about making this work? Thanks! 回答1: You're going to have to download and cache all the content for each page manually, then recreate them as local pages. There's nothing like Mac OS's .webarchive format on iPhone to save web content. 回答2: This is a similar question, but the intent was slightly different. This answer provides detail on

iPhone SDK: Tell UIWebView not to load images and CSS just plain HTML and JS?

半城伤御伤魂 提交于 2019-12-11 16:58:21
问题 Is there any way to tell a UIWebView not to load images and CSS for faster rendering? Solution: URL filtering for UIWebView on the iPhone 回答1: Use media queries. The first one says "if it is not an iphone, use the normal style sheet", the second says "if it is an iphone, implement style rule: don't display images" : <link type="text/css" rel="stylesheet" media="not (max-device-width: 480px)" href="normalstyle.css"> <style type="text/css"> @media (max-device-width: 480px) { img { display: none

UIWebView doesn't detect text box on website

十年热恋 提交于 2019-12-11 16:57:03
问题 I have a UIWebview that loads the e-mail website for my school. When you log in, you can view and read mail with no problem, but if you goto compose an e-mail or reply to one, you are unable to touch inside the message text box to write your e-mail. I thought it was a problem with the actual e-mail client my school uses, but when I goto the website on Safari I am able to touch in the message box and write an e-mail as usual. If you have any insight on why this would happening, i'd appreciate

How to pass single touch events to super view in UIWebView?

梦想的初衷 提交于 2019-12-11 16:19:36
问题 I am using UIWebView to display pdf. I wanna handle touch events on webview. There are two conditions, my WebView should handle double touch events and gestures, and i wanna pass single tap/touch events to super view. Can any one please tell me how to differentiate the touch events in UIWebView and how to pass specific touch events to its super view? to get the touch events i am subclassing the uiwebview and im overriding the hitTest method in subclass. 回答1: If that post is not answering your

iPhone SDK: Loading resources from custom URL scheme

喜夏-厌秋 提交于 2019-12-11 15:48:32
问题 I have HTML string which is created using an xml file by a third party library. The HTML string contains custom URLs for images and videos (Ex:image://). Is there is way by I can handle these resource load request and load them correctly in UIWebView? 回答1: You should be able to change them to a file:// url that points to a file inside the application bundle. To get the path you can use: NSString *path = [[NSBundle mainBundle] pathForResource:@"MyFileInResources" ofType:@".png"]; Note that you

Different Orientation for Different Views?

核能气质少年 提交于 2019-12-11 15:32:57
问题 I'm making an iOS application that has an interface in the portrait view. However, when displaying web content I want the view to display in a landscape format, because I want the website test to display larger initially without the user needing to zoom. Can I tell the program so present this view only in landscape? Thank you. 回答1: looks like you want to force the orientation to landscape mode only.. heres my solution in MyViewController.h add this code on top of MyViewController's @interface

Open in Safari from UIWebView (using youtube.com)

家住魔仙堡 提交于 2019-12-11 15:04:03
问题 This has been the most frustrating thing I've ever had the misfortune of doing, ever. I have a UIWebView. It goes to http://m.youtube.com. I want any subsequent link I press to then be sent to Safari, not the UIWebView. Simple, right? Here's the code you'll find over and over again: - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { if (navigationType == UIWebViewNavigationTypeLinkClicked) { [

Programmatically display keyboard in UIWebView

被刻印的时光 ゝ 提交于 2019-12-11 14:28:44
问题 If an element in a UIWebView has the style property -webkit-user-modify:read-write, then pressing on the element causes the keyboard to appear. Is it possible to bring up the keyboard programatically? Thanks 回答1: It looks like in iOS6 now you can do this with " keyboardDisplayRequiresUserAction ": keyboardDisplayRequiresUserAction A Boolean value indicating whether web content can programmatically display the keyboard. @property (nonatomic) BOOL keyboardDisplayRequiresUserAction Discussion

WebView:How to detect if I am on the original web page and execute a certain method

有些话、适合烂在心里 提交于 2019-12-11 14:25:21
问题 I have this method that goes back to previous webpage in a web view under certain circumstance and it works fine. However, I want to implement a function that checks if I am on the original web page and if so, when I push the back button it takes me to a navigation view controller. The original page is this code [webView loadHTMLString:self.item.description baseURL:[NSURL URLWithString:self.item.link]];. Now I need to figure out how to check if I am on that page and if so I need to execute

Are HTML5 <video> tags be broken in iOS 6.1 apps using UIWebView (PhoneGap)?

只谈情不闲聊 提交于 2019-12-11 14:22:52
问题 We have a PhoneGap application that uses HTML5 video tags. If you click the "Done" button while a video is playing, the video stops, but the video element shows a double preview image: One in the background, which is rotated 90º and one in the foreground that is the correct orientation. Has anyone else experienced this and do you know of a workaround? 来源: https://stackoverflow.com/questions/14687731/are-html5-video-tags-be-broken-in-ios-6-1-apps-using-uiwebview-phonegap