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