uiwebview

How to disable UIWebview horizontal scrolling?

我的未来我决定 提交于 2019-12-03 09:56:33
问题 I've tried disabling it by inserting: <meta name="viewport" content="width=320" /> into my HTML string, and a dozen variations of the above in the vain hope that I just screwed up the tag syntax... but nothing seems to stop UIWebView from scrolling horizontally. And yet there are apps that manage to do this (like MobileRSS), and presumably, since they haven't gotten rejected, they're not using private APIs. 回答1: My version, a common solution: - (void)webViewDidFinishLoad:(UIWebView *)webView

UIWebView to UIImage

对着背影说爱祢 提交于 2019-12-03 09:56:02
问题 I tried to capture image from UIWebView using this method but the image contains only visible area of the screen. How do I capture full content of UIWebView including invisible areas, i.e. the entire web page into one single image? -(UIImage*)captureScreen:(UIView*) viewToCapture{ UIGraphicsBeginImageContext(viewToCapture.bounds.size); [viewToCapture.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();

Prevent universal links from opening in `WKWebView`/`UIWebView`

你。 提交于 2019-12-03 09:55:31
问题 When user tap on a universal link in WKWebView , the corresponding app will be opened (if installed). This is described in Apple Search Programming Guide If you instantiate a SFSafariViewController, WKWebView, or UIWebView object to handle a universal link, iOS opens your website in Safari instead of opening your app. However, if the user taps a universal link from within an embedded SFSafariViewController, WKWebView, or UIWebView object, iOS opens your app. In my app, I have a WKWebView ,

How to cancel a UIWebView?

柔情痞子 提交于 2019-12-03 09:53:54
问题 I'm modally presenting a UIViewController with a UIWebView as its view. How do I dismiss the UIWebView when the user hits a cancel button on it? One idea I have is to have the cancel button link to http://cancel and then check in - (void)webViewDidStartLoad:(UIWebView *)webView If webView.request.URL.host isEqualToString:@"cancel" , then dismiss the view controller. Does the host have to have a dot in it, e.g., "cancel.com"? 回答1: You're on the right path, but you're approach is slightly off.

How to change the character encoding in UIWebView?

China☆狼群 提交于 2019-12-03 09:42:15
Summary of the problem: When browsing non-English sites that does not explicitly specify the correct character encoding with UIWebView on the iOS, the page cannot be displayed correctly. Detailed explanation: As the loadRequest: method in UIWebView will use the encoding specified in the charset header sent from the web server or the charset written in the HTML meta tag, and default to iso-8859-1 (well, I am not too sure about this) when charset is not specified, which cause non-English sites cannot display properly. I have tried to Google for a way to change the charset that the UIWebView use,

How to send events from HTML running inside a UIWebView to native Objective-C code?

我的未来我决定 提交于 2019-12-03 09:38:37
问题 I want to integrate a full HTML framework (ie HTML/CSS/JavaScript) inside an iOS app and make the UIWebView in charge of running the HTML content being able to communicate with the rest of the native Objective-C source code. Direction 1: from Objective-C to HTML inside a UIWebView The way to make the rest of the source send messages to the HTML content is pretty straightforward: i can just call stringByEvaluatingJavaScriptFromString: on the Objective-C side and implement JavaScript methods

Flutter: How to fix ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs

耗尽温柔 提交于 2019-12-03 09:24:31
When submitting my latest build, Apple suddenly returned a message saying that there was an issue, specifically: ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . See https://developer.apple.com/documentation/uikit/uiwebview for more information. Since I'm not using the webview plugin I'm at a loss as to where the UIWebView API is being used. Any advice on how to solve this? This error appears with the latest stable flutter build 1.7.8+hotfix.4 and with the following packages included: http: ^0.12.0 shared_preferences: ^0.4.3 intl: any

Do UIWebView and NSURLConnection share cookie storage?

非 Y 不嫁゛ 提交于 2019-12-03 09:19:29
问题 I'm building an iOS app that uses Google App Engine for the backend. Google provides an HTML login site that stores an authentication cookie. If I visit that site in a UIWebView, and the user logs in, will those cookies be in storage where they will be picked up by a NSURLConnection when making a request to the same site? 回答1: The cookie of the UIWebView will be stored in a sandboxed cookie storage accessible through NSHTTPCookieStorage sharedHTTPCookieStorage] . You can use this cookie

Alert displayed when tapping links in UIWebView with Guided Access enabled under iOS 8

陌路散爱 提交于 2019-12-03 09:09:20
I have written a fairly basic iOS app that makes use of web content via a UIWebView element. The app needs to run in Guided Access mode as it is running in a customer-facing retail environment. Under iOS 7 all worked fine, but since updating to iOS 8 an alert "Guided Access is enabled. Triple-click the home button to exit" is displayed at the top of the screen almost every time a link on the web page is tapped. I've tried creating a new app from scratch that has nothing other than a UIWebView element in it, and the problem still occurs. I've filed a bug with Apple, but am urgently seeking a

How to tell the difference between an iframe loading vs. entire page loading in a UIWebView?

限于喜欢 提交于 2019-12-03 09:08:35
问题 In the [webView:shouldStartLoadWithRequest:navigationType:] event, how can you tell the difference between an iframe that's loading content vs. the entire page loading content? It seems like the both call this same event with the same arguments, the only difference being the URL that's going to be loaded, so there is no way to tell the difference between the two. I've thought of a few ways to tell the difference though: Parse the source code of the page and store a list of all the iframe src