UICollectionView's cellForItemAtIndexPath is not being called

后端 未结 30 2444
再見小時候
再見小時候 2020-12-07 11:11

Only my second time using UICollectionView\'s and perhaps I have bitten off more than I can chew but nevertheless:

I am implementing a UICollectionView (myCollection

30条回答
  •  一生所求
    2020-12-07 11:48

    For me, I update the height of self.view (the collectionView's superview) via autolayout, and MUST call layoutIfNeeded after that.

    [self.view mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(@(height));
    }];
    [self.view layoutIfNeeded];
    

提交回复
热议问题