uiwebview

How change min and max zoom scale in WKWebView?

ε祈祈猫儿з 提交于 2019-12-04 16:46:11
I use WKWebView to show svg. It's rather big and i need support of scaling it on pinch gesture. WKWebView do it out of the box. But. It has it's own constraints for min and max zoom scale. For example: subscribe to WKWebView's scrollView delegate and implement method optional func scrollViewDidEndZooming(_ scrollView: UIScrollView, with view: UIView?, atScale scale: CGFloat) { print(self.wkWebView.scrollView.minimumZoomScale, self.wkWebView.scrollView.maximumZoomScale) self.wkWebView.scrollView.minimumZoomScale = 0.01 self.wkWebView.scrollView.maximumZoomScale = 20.0 } And in next call it will

How to change the character encoding in UIWebView?

半世苍凉 提交于 2019-12-04 15:37:20
问题 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

Delegate to know when phone call ends which was initiated by app

无人久伴 提交于 2019-12-04 15:07:59
I have a code which places a phone call using below code : // Make a call to given phone number - (void)callPhoneNumber:(NSString *)phoneNumber { if (!self.webview) self.webview = [[UIWebView alloc] init]; self.webview.delegate = self; // Remove non-digits from phone number phoneNumber = [[phoneNumber componentsSeparatedByCharactersInSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]] componentsJoinedByString:@""]; // Make a call NSURL * url = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@", phoneNumber]]; [self.webview loadRequest:[NSURLRequest requestWithURL:url]]; [self

YouTube Autoplay Possibilities In IOS

一世执手 提交于 2019-12-04 15:07:47
I have created a webView: videoView.delegate = self; videoView.userInteractionEnabled = true; [videoView loadRequest:[[NSURLRequest alloc]initWithURL:[[NSURL alloc] initWithString:@"website"]]]; I have html/javascript to handle the video's loading as well as the autoplay and next video. This all works, but my problem is that IOS autoloads the quicktime - like player, which is also a good thing, but I do not know how to control that, nor do I know how to get the video to play once that has happened. I would like the button that shows up in the player to autoplay. I would like that to happen

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

纵然是瞬间 提交于 2019-12-04 15:04:48
问题 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

Unable to Completely Reclaim Memory Usage from UIWebView

 ̄綄美尐妖づ 提交于 2019-12-04 14:55:41
I have the following sample code (using ARC) which adds a UIWebView as a subview and subsequently removes it (toggled by a tap gesture on the screen): - (void)toggleWebViewLoading:(UITapGestureRecognizer *)sender { if (webView == nil) { webView = [[UIWebView alloc] initWithFrame:CGRectMake(0.0f, 100.0f, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - 100.0f)]; [webView loadRequest:[[NSURLRequest alloc] initWithURL:[[NSURL alloc] initWithString:@"http://www.google.ca"]]]; [self.view addSubview:webView]; } else { [webView removeFromSuperview]; webView = nil; }

Load document directory image into web view [closed]

淺唱寂寞╮ 提交于 2019-12-04 14:51:54
I have a an Xcode project with UIWebView . Now I need to load an image from document directory to that webview. How can I acheive this? NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *imagePath = [documentsDirectory stringByAppendingPathComponent: [NSString stringWithFormat: @"/imageName.png"]]; [myWebView loadHTMLString:[NSString stringWithFormat:@"<html><body><img src=\"file://%@\"></body></html>",imagePath] baseURL:nil]; 来源: https://stackoverflow.com/questions/12367212/load

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

放肆的年华 提交于 2019-12-04 14:49:24
问题 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

How to log into web site using uiwebview with swift?

非 Y 不嫁゛ 提交于 2019-12-04 14:35:18
I want to try to log into a web page using UIWebView in an ios applicaiton. However, I do not know how can I do this. I am showing web site with let url = NSURL(string: "http://m.falalem.com") let request = NSURLRequest(URL: url!) webView.loadRequest(request) I want to log into this page using my username and password parameter. Login Page -> http://m.falalem.com/Login After login page -> http://m.falalem.com/User-Info How can log into this page using uiwebview?? Please help! Logging into a webpage in general (using JS, PHP, etc.) uses a POST request, right? Specifically on your website, for

Get word under tap from UIWebView using JavaScript

…衆ロ難τιáo~ 提交于 2019-12-04 14:34:46
I'm displaying some local web content and would like to get the word under the tap point. The single tap delegate is setup and I can get it to work great if I use a UITextView and load the HTML with a NSAttributedString and NSHTMLTextDocumentType, but I lose formatting such as paragraph spacing and small caps; adding a NSMutableParagraphStyle is without effect. Using a UIWebView and loadHTMLString that includes JQuery, is there a way? There are several pages which show how to use JS to get the word under the cursor, such as the following: How to get a word under cursor using JavaScript? How to