当我的收藏 View 位于底部并且我将其从纵向更改为横向时,单元格会从 View 中消失,直到我必须将它们向下拖动,如下所示:
常规肖像 View :
旋转成横向时的 View :
从 View 顶部拖动单元格:
我该如何解决这个问题?
最佳答案
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
duration:(NSTimeInterval)duration
{
if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation))
{
self.collectionViewObj.frame = CGRectMake(0, 0, 568, 320);
}
else
{
self.collectionViewObj.frame = CGRectMake(0, 0, 320, 568);
}
}
关于ios - UICollectionView 方向改变事故?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32090970/