【发布时间】:2016-07-14 20:32:14
【问题描述】:
我在一个单元格中有 WKWebView,但问题是当旋转手机时,我得到了 WkWebView 滚动高度的旧值,因此内容没有完全加载。
override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
self.contentHeights[3] = self.webView.scrollView.contentSize.height
}
这个方法改变了表格单元格的行高,但我得到的值是在旋转之前。
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat
{
if indexPath.row == 3{
return contentHeights[indexPath.row]
}else{
contentHeights[indexPath.row] = UITableViewAutomaticDimension
return contentHeights[indexPath.row]
}
}
func tableView(tableView: UITableView, estimatedHeightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
if indexPath.row == 3{
return contentHeights[indexPath.row]
}else{
return UITableViewAutomaticDimension
}
}
第 3 行是 WkWebView Any Help???
【问题讨论】:
标签: ios swift wkwebview screen-rotation