如何在iPhone 6和iPhone 6plus的ios中删除Collection View Cell之间的空间?

princ___y

我有一个简单的方法,CollectionView但在iphone 45和5s中效果很好但是当我在运行iphone 66plus它看起来像

在此处输入图片说明

但我想删除iphone 6之间的单元格之间的空间6 plus它是删除空间的属性吗?如果是财产,请告诉我。

拉胡尔·帕特尔(Rahul Patel)
- (CGSize)collectionView:(UICollectionView *)collectionView
                  layout:(UICollectionViewLayout *)collectionViewLayout
  sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
    float width = collectionView.frame.size.width / 2;
    return CGSizeMake(width, width);

}

对于斯威夫特

func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize
{
    return CGSizeMake(collectionView.frame.size.width/2, collectionView.frame.size.width/2)
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

没有3x启动图像但支持iPhone 6和iPhone 6plus的iOS App提交

如何在同一情节提要中缩放iPhone 5和iPhone 6屏幕?

如何在iPhone 6和6 Plus模拟器中启动使用Titanium构建的iOS应用程序?

支持iPhone 6和6 plus

如何减少collectionviewcell和collection view之间的顶部空间

仍未针对iPhone 6和iPhone 6 Plus优化

如何为iPhone 5和iPhone 6创建不同的约束

iPhone 6和6 Plus中的tableview约束

如何在 iPhone 6 上运行 ARKit?

苹果是否已删除“针对iPhone 6和iPhone 6 Plus进行了优化”?

如何将iOS键盘应用程序限制为仅iPhone 6和iPhone 6 Plus

对于iPhone 6和iPhone 6 +,setSelectionIndicatorImage的尺寸错误

iPhone 6和iPhone 6 Plus是否支持为iPhone 4和iPhone 5制作的应用程序

如何在iPhone 6 Plus上完美绘制Pixel?

更新的尺寸类别的xib在iPhone 6和iPhone 6 Plus中不显示iAd

iPhone 5和iPhone 6中的不同Int类型

iPhone 6和6 Plus媒体查询

iPhone 6和6 Plus的AutoLayout TableView问题

区分iPhone 5、6和6 Plus的尺寸等级?

Xcode for iPhone 6和6 Plus的居中表格视图

如何在iPhone 6中使iFrame响应?

iPhone 6和iPhone 6 plus支持必须与64位和iOS 8一起使用?

不同的启动图像iPhone 6和iPhone 4s

如何使用Xcode 6为iPhone和iPad创建XIB?

如何在Ubuntu和iPhone之间移动文件

WatchConnectivity,如何在iPhone和Apple Watch之间共享阵列

仅Storyboard和iPhone 6横向

在iPhone iPhone 6 plus中,全角组件的左侧和右侧都有边距

在iPhone 6和6 plus中设置背景图像和图标图像