2016-02-16 88 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