IOS 10中的UIWebView不滚动问题

时间:2016-11-09 06:11:59

标签: ios objective-c uiwebview

我面临一个奇怪的问题。我用。创建了一个本地的.html文件 以下代码。代码工作到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];

1 个答案:

答案 0 :(得分:0)

尝试

self.myWebView.scrollEnabled = TRUE;