作者:金玉的海角_745 | 来源:互联网 | 2023-05-22 08:46
在我的集合视图布局(我的子类UICollectionViewFlowLayout
)中定义了:
- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds {
return YES;
}
我的期望是,由于旋转是一个边界变化,我的布局将重新计算.但是,当我在以下位置设置断点时:
- (CGSize)collectionView:(UICollectionView *)collectionView
layout:(UICollectionViewLayout *)collectionViewLayout
sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
屏幕旋转时不会触发断点.有谁知道为什么?