4

我的项目有一个自定义单元的UICollectionView,用于在iOS8之前在iPhone和iPad上完美地工作。现在在第一个称重传感器上的iPad看起来很完美,但是在旋转时iOS8 Xcode6 UICollectionView sizeForIndexPath:不会调用旋转

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath 

不会被调用。

问题是这是我的旋转逻辑去,这就是为什么我的UICollectionView抽搐。

回答

1

这里是解决它: 我加底线我didRotateFromInterfaceOrientation:方法

-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{ 
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; 
[self.collectionView performBatchUpdates:nil completion:nil]; 

}

+1

我看到同样的事情。问题在于旋转动画发生后,didRotateFromInterfaceOrientation发生,并且结果非常难看。我在viewWillLayoutSubviews中试过这个黑客攻击,但它没有奏效。任何人在轮换过程中都找到了解 – cetcet 2014-09-23 23:05:57