Commit d087ff4b authored by 朱璇's avatar 朱璇

数据为空增加判断

parent a105c7a6
......@@ -50,7 +50,7 @@
[self.collectView performBatchUpdates:^{
[weakSelf.collectView layoutIfNeeded];
} completion:^(BOOL finished) {
if (finished) {
if (finished && dataArray.count > 0) {
NSIndexPath *firstIndexPath = [NSIndexPath indexPathForItem: 0 inSection:0];
[self.collectView scrollToItemAtIndexPath:firstIndexPath atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES];
_layout.currentIndex = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment