我的一个 Storyboard
有一个 TableView 单元格,它调用在单独场景中定义的 Collection View 。 Collection View 包括一个带有页面控件的 UIImage View ,直到 ios 10 升级后,每个图像都用于在 imageview 中完全显示在我重新访问 Storyboard之前,一切都变得正常。新升级中的 UIImage 或 collectionview 有什么变化吗?
相同的代码在 ipod 中运行良好。
代码示例:
#pragma mark - UICollectionViewDelegateFlowLayout
- (CGSize)collectionView:(UICollectionView *)collectionView
layout:(UICollectionViewLayout *)collectionViewLayout
sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
return collectionView.bounds.size;
}
是否与使用的pagecontrol有关??
最佳答案
我希望您之前使用过 sizeForItemAtIndexPath
来指定 Collection View 单元格大小,并且会添加 UICollectionViewDataSource、UICollectionViewDelegate
委托(delegate)方法。
现在对于 iOS 10,我们需要添加 UICollectionViewDelegateFlowLayout
委托(delegate),然后才会执行 sizeForItemAtIndexPath
。
尝试一下,希望它能解决您的问题。
关于ios - Collection View 显示堆叠在单个 View 中的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40625583/