2016-11-09 78 views
1

我正面臨一個奇怪的問題。我使用以下代碼創建了一個本地.html文件,使用 。代碼工作到iOS9,但在iOS10 UIWebView不滾動。UIWebView在IOS 10中不滾動問題

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]; 

回答

0

嘗試

self.myWebView.scrollEnabled = TRUE; 
+0

增加仍然面臨着同樣的問題 –

+0

Tryself.myWebView.scalesPageToFit = TRUE; – stevenpcurtis

+0

你還使用clipstobounds? – stevenpcurtis