Home > Mobile >  Use WKWebView iOS, after page pop-up keyboard input, will trigger a jQuery the resize event
Use WKWebView iOS, after page pop-up keyboard input, will trigger a jQuery the resize event

Time:09-26

Everyone who come across this problem, the master who know how to solve, please let down, please, (problem description, using WKWebview loading web pages, click page input box, pop-up keyboard web content be amplified,)

CodePudding user response:

- (UIView *) viewForZoomingInScrollView: (scrollView UIScrollView *)
{

Return nil.

}

CodePudding user response:

- (void) webView: (WKWebView *) webView didFinishNavigation: (WKNavigation *) navigation {

Nsstrings * injectionJSString=@ "var script=document. The createElement method (" meta");"
"Script. Name=" viewport ';"
"Script. The content=" width=device - width, user - scalable=no \ ";"
"Document. GetElementsByTagName (' head ') [0]. The appendChild (script); and";
[_webView evaluateJavaScript: injectionJSString completionHandler: nil];

NSLog (@ "loading finish");

}
  •  Tags:  
  • iOS
  • Related