[英]Content Fit Inside UIWebView
在您的情況下, webView.scalesPageToFit = true
但仍不適合Webview,似乎對tableview的tableviewcell大小有問題,可能最初沒有找到准確的重新加載tableview可以解決此問題,如果與tableview重新加載相關的代碼可以幫助您嘗試以下代碼
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
self.YOUR_TABLEVIEW.reloadData()
}
希望這個能對您有所幫助
試試這個方法:
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
//Access web view form cell here
// then use [webObj sizeToFit];
// then get height of web view and return it as height of cell
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.