2016-02-16 87 views

回答

0

先试着改变你的ImageView内容模式.AspectFit。如果你想要显示整个图像,第二个图像实际上是正确的。它看起来像是在开始变成互动时重新绘制图像。尝试在加载单元格以解决问题时调用cell.yourImageView.layoutIfNeeded()。如果这是一个UIViewController,并且不起作用,请尝试将autodiminsions的代码移到实际的函数中。

func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { 
return UITableViewAutomaticDimension 

}

func tableView(tableView: UITableView, estimatedHeightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { 
return closeGuess //maybe 200 

}

+0

尝试添加cell.yourImageView.layoutIfNeeded()FUNC的tableView里面(的tableView:UITableView的,的cellForRowAtIndexPath indexPath:NSIndexPath) - > UITableViewCell的,但没有奏效。我也尝试添加两个函数heightforrow并估计hightforrow,但结果仍然相同 – bdc

+0

尝试将您的imageview contentmode属性更改为.AspectFit – agibson007