简体   繁体   English

IOS 10中的UIWebView不滚动问题

[英]UIWebView not scrolling issue in IOS 10

I am facing a strange problem. 我面临一个奇怪的问题。 I have created a local .html file using the following code. 我使用以下代码创建了一个本地.html文件。 The code is working till iOS9 but in iOS10 UIWebView is not scrolling. 代码工作到iOS9,但在iOS10 UIWebView不滚动。

self.automaticallyAdjustsScrollViewInsets = NO;
self.myWebView.delegate = self;
self.myWebView.userInteractionEnabled = YES;
NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"Sample" ofType:@"html"];
NSURL *baseURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
NSString *htmlBody = [[NSString alloc] initWithContentsOfFile:htmlFile usedEncoding:nil error:nil];
htmlBody = [htmlBody stringByReplacingOccurrencesOfString:@"Most-Common-Que3-Paragraph1" withString:@"In a small village, a little boy lived with his father and mother. He was the only son.The parents of the little boy were very depressed due to his bad temper"];
[self.myWebView loadHTMLString:htmlBody baseURL:baseURL];

尝试

self.myWebView.scrollEnabled = TRUE;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM