pri*_*__y 4 objective-c ios uicollectionview
我有简单的CollectionView,但它运作良好,在iphone 4与5和5秒.但是当我在运行iphone 6和6plus它看起来像
但我想删除iphone 6和之间的空格6 plus.是删除空间的属性?如果属性请告诉我.
- (CGSize)collectionView:(UICollectionView *)collectionView
layout:(UICollectionViewLayout *)collectionViewLayout
sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
float width = collectionView.frame.size.width / 2;
return CGSizeMake(width, width);
}
Run Code Online (Sandbox Code Playgroud)
对斯威夫特来说
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize
{
return CGSizeMake(collectionView.frame.size.width/2, collectionView.frame.size.width/2)
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1110 次 |
| 最近记录: |