uiwebview

Shared NSURLCache and UIWebView on iOS 8

狂风中的少年 提交于 2019-12-07 02:01:09
问题 In iOS 7, I was able to set a shared URL cache to a subclass of NSURLCache and any UIWebView s I created would automatically use that shared cache for each request. // Set the URL cache and leave it set permanently ExampleURLCache *cache = [[ExampleURLCache alloc] init]; [NSURLCache setSharedURLCache:cache]; However, now in iOS 8 it doesn't seem like UIWebView pulls from the shared cache and cachedResponseForRequest never gets called. Has anyone found documentation for this change, or a

UIWebview resize height to fit content

天涯浪子 提交于 2019-12-07 01:03:05
问题 I know this has been asked many times but I can not get it to work. In short my UIWebview pulls in some HTML which has a none fixed height (width always the same), I just want the height to change accordingly. I have tried a number of fixes I have found online but my problem is the webview will change to the correct size but only for a brief second and then in flicks back to the original size. I should point out that my this view is invoked by a segue, that is the only thing I can think is

UIWebView and timeouts

十年热恋 提交于 2019-12-07 00:34:47
问题 I'm using a UIWebView to display some content. Within this content the user can navigate through a bunch of sites which are being loaded using AJAX. One step on this sites requires quite some time. Since I didn't find anything about a timeoue for UIWebView I tried to set it on the initial NSURLRequest it loads. Unfortunately this does not seem to do anything. I'm not quite sure if I'm supposed to set the timeout myself? Is there anything I'm missing? Does the UIWebView override my timeout? I

How to set a custom keyboard for UIWebView

偶尔善良 提交于 2019-12-06 23:57:57
问题 How to show a custom keyboard and Input Accessory View for a editable UIWebView for iOS7 and up. i.e: How can i set and make use a value from [UIWebView setInputView:] and [UIWebView setInputAccessoryView:] 回答1: It would be helpful to understand what you're trying to do? You can either be trying to force a specific type of keyboard such as numeric, email, etc. that will use the keyboard the user has explicitly installed on their device (or the system one). In order to do this, you can

How to prevent UIWebView video from getting remote control events

為{幸葍}努か 提交于 2019-12-06 23:38:44
问题 I am using UIWebView in an iOS app to play YouTube videos but to provide native experience, I've implemented playback controls using UIKit. So the UIWebView is only used to display video. I've also implemented -remoteControlReceivedWithEvent: to allow control from Control Center and controller buttons on earphones. But it seems that UIWebView automatically handles remote control events from the earphones. This is a problem because when you toggle play/pause, my code would pause the video and

How can I know when the Magnifying Glass comes up in UIWebView?

和自甴很熟 提交于 2019-12-06 22:46:40
How I can detect when the magnifying glass comes up in a UIWebView? Assuming you're writing an app to release on the app store, you can't - the structure of a UIWebView is opaque to you, and you can't drill down into its component parts. Whilst I suspect it would be possible to descend into its structure and figure out exactly what was getting triggered when, you run a very large risk that Apple will change UIWebView's structure in a subsequent OS update and break your app. So unless you're going outside of the public API (and thus making available through channels other than the app store) I

How can I prevent keyboard autocompletion in MobileSafari/UIWebView?

拈花ヽ惹草 提交于 2019-12-06 22:27:03
问题 I'm implementing my own autocompletion on an <input> field inside a UIWebView, and the built-in keyboard autocompletion interferes with the user experience. Is there a way to use HTML or Javascript to signal to iOS that it shouldn't try to autocomplete? 回答1: In my comments I mentioned using the html attribute autocomplete but I tested it, and it doesn't address your issue. However, there is an attribute specific to Mobile Safari which may help. You could try turning off autocorrect like so:

UIWebView content height not accurate in scrollview.contentsize

你离开我真会死。 提交于 2019-12-06 22:01:08
问题 I am trying to scroll to a particular page in a pdf document I have loaded in a UIWebView. I am able to do this without a problem in iOS 5 using: pageHeight = webView.scrollView.contentSize.height / numberOfPages; [[webView scrollView] setContentOffset:CGPointMake(0,pageNumber*pageHeight) animated:YES]; This only works however if the page has been loaded into the view already and the scroll to is triggered by a user action. For the case where I want to load a new pdf into the webview to a

Can I use username and password information from UITextFields to log onto a website in a UIWebView automatically?

寵の児 提交于 2019-12-06 21:36:43
I am currently trying to find a solution to this task. Essentially I have an initial UIView that asks for the users username and password for a specific site, this information would then get past onto the next view which has a UIWebView inside. I would like to know if its possible to automatically fill in the username and password details on the site and send the user directly to their account page on the site. Thanks. assuming your website has div tags you can inject using stringByEvaluatingJavsScriptFromString. This example injects a username into the twitter sign up page. You can test it by

Back Button on UIWebView

时间秒杀一切 提交于 2019-12-06 21:24:22
问题 I'm trying to figure out how to create a back button that allows the user to go back one page. I read through Apple's Docs (which still go way over my head) and found out that I need to setup the canGoBack and goBack 's. I have tried this, but for some reason it is not working. My UIWebView is named viewWeb , and I created and attached an outlet to my Back button, named backButton , and also tagged it as 1. Here is my code that I wrote in the View Controller: // Back button: -(void