计算更新collectionView的高度
//计算collectionView的高度
-(void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath
{
if (collectionView == self.typeConllectionView) {
dispatch_async(dispatch_get_main_queue(), ^{
// 设置高度
CGFloat tagViewHeight = self.typeConllectionView.contentSize.height;
[self.typeConllectionView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.equalTo(@(tagViewHeight));
}];
[self.teacherListCollectionView layoutIfNeeded];
});
}
}
本文标题:计算更新collectionView的高度
本文链接:https://www.haomeiwen.com/subject/vhjmrftx.html
网友评论