使用AutoLayout自定義Cell的高度之后,展開Cell 調(diào)用reloadData時(shí)會(huì)發(fā)生contentOffset跳動(dòng),使用下面的方法就可以解決跳動(dòng)問題。
CGPoint offset = self.collectionView.contentOffset;
[self.collectionView reloadData];
[self.collectionView.collectionViewLayout invalidateLayout];
[self.collectionView layoutIfNeeded];
[self.collectionView setContentOffset:offset];