UiWebView 不显示响应式网页
UiWebView not displaying responsive webpages
我正在尝试在 UIWebView 中显示网页。但它没有正确显示网页。所有网页都是响应式的。
下面是我的代码
_webview.delegate = self;
[self.webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:_webURL]]];
[_activityLoading startAnimating];
-(void)webViewDidFinishLoad:(UIWebView *)webView{
[_activityLoading stopAnimating];
[_webview stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.querySelector('meta[name=viewport]').setAttribute('content', 'width=%d;', false); ", (int)webView.frame.size.width]];
}
它在 Safari 中正常显示。
请帮忙
出现问题的设备是 iOS 9.3。升级 xCode 后它工作正常。之后没有遇到与 UIWebView 相关的任何其他问题。
我正在尝试在 UIWebView 中显示网页。但它没有正确显示网页。所有网页都是响应式的。
下面是我的代码
_webview.delegate = self;
[self.webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:_webURL]]];
[_activityLoading startAnimating];
-(void)webViewDidFinishLoad:(UIWebView *)webView{
[_activityLoading stopAnimating];
[_webview stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.querySelector('meta[name=viewport]').setAttribute('content', 'width=%d;', false); ", (int)webView.frame.size.width]];
}
它在 Safari 中正常显示。
请帮忙
出现问题的设备是 iOS 9.3。升级 xCode 后它工作正常。之后没有遇到与 UIWebView 相关的任何其他问题。