0
我有WKWebView在一个单元格内,但问题是当旋转手机时,我得到WkWebView滚动高度的旧值,因此,完全加载。WKWebView在旋转手机后得到旧值滚动高度iOS9
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任何帮助?