【发布时间】:2016-11-09 06:11:59
【问题描述】:
我遇到了一个奇怪的问题。我使用创建了一个本地 .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];
【问题讨论】:
标签: ios objective-c uiwebview