美文网首页iOS 开发中的点点滴滴
ios webView 高度的变化(用监听的方法)

ios webView 高度的变化(用监听的方法)

作者: 路人甲_kbb | 来源:发表于2018-09-10 10:47 被阅读0次

[self.webView.scrollView addObserver:self forKeyPath:@"contentSize" options:NSKeyValueObservingOptionNew context:nil];

-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context{
CGFloat heightS = self.content.scrollView.contentSize.height;
_webHeight = heightS;
[self.tableview reloadData];
}

随手记录,点点滴滴;

相关文章

网友评论

    本文标题:ios webView 高度的变化(用监听的方法)

    本文链接:https://www.haomeiwen.com/subject/lrxseftx.html