隱知識:reloadData 方法以後,view並不會當即更新其contentSize

在使用UITableView 、UICollectionView ,調用reloadData方法以後,並不當即更新其contentSize。緣由以下:http://jacksonriver.com/news/ios-adventures-uitableview-animation-callbacks-key-value-observingios

若想使其當即更新contentSize,能夠顯示地調用 layoutSubviews 或 layoutIfNeeded。ui

 

更多:http://stackoverflow.com/questions/9958328/when-does-a-uitableviews-contentsize-get-setspa

相關文章
相關標籤/搜索