【问题标题】:UIWebView not scrolling issue in IOS 10IOS 10中的UIWebView不滚动问题
【发布时间】: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


    【解决方案1】:

    试试

    self.myWebView.scrollEnabled = TRUE;
    

    【讨论】:

    • 添加仍然面临同样的问题
    • Tryself.myWebView.scalesPageToFit = TRUE;
    • 你也在使用 clipstobounds 吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-26
    • 1970-01-01
    • 2015-05-19
    • 2023-03-23
    • 1970-01-01
    • 2020-04-06
    • 2012-06-08
    相关资源
    最近更新 更多