2016-03-09 48 views
0

我試圖解決這個問題近兩天!我還沒有找到任何解決方案。reloadData的UITableView與動態單元高度不需要的滾動

我有動態單元格高度應該是一個實現代碼如下,我使用此代碼

tableView.rowHeight = UITableViewAutomaticDimension 
tableView.estimatedRowHeight = 300.0 

對於我的tableView我使用的是infinit scroll庫加載動態高度更多的數據。

在某些情況下,我正在使用更新的數據重裝我的tableview!當我調用reloadData()tableview向上或向下滾動時。修復了estimatedRowheight應該是高至少550.0

tableView.estimatedRowHeight = 550.0

當這個問題解決我與infinitscroll另一個問題,當我打電話self.tableView.finishInfiniteScroll()所述的tableView向上滾動(跳動的)

self.tableView.beginUpdates() 
self.tableView.insertRowsAtIndexPaths(indxesPath, withRowAnimation: UITableViewRowAnimation.Fade) 
self.tableView.endUpdates() 
self.tableView.finishInfiniteScroll() 

我正在使用AutoLayout!和我測試的的iOS 9.1

+0

你需要設置的內容了滾動 –

+0

偏移只知道,從哪兒來你得到價值550.0並且修理了Jerking Issue? :)它也拯救了我的一天。 –

回答

0

試試這個,不表給予高度和細胞的任何地方

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

func tableView(tableView: UITableView, estimatedHeightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat 
{ 
    return 44.0 
} 
相關問題