UICollectionView 太宽.我怎样才能使它成为设备的宽度? [英] UICollectionView is too wide. How can i make it the width of the device?

查看:17
本文介绍了UICollectionView 太宽.我怎样才能使它成为设备的宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在情节提要中创建了一个新的 UICollectionView.我的问题是单元格试图适应比设备宽度更大的宽度,所以右边的单元格被切断了.有什么好的方法可以解决这个问题?

I created a new UICollectionView in the storyboard. My problem is that the cells try and fit a larger width than the width of the device, so the ones on the right get cut off. What's a good way to fix this?

推荐答案

您需要固定 UICollectionview 的所有边缘...查看此处

you need to pinned all edges of your UICollectionview...check out here

通过固定所有边缘,您将获得相同的屏幕高度和宽度

By pinned all edges, you'll get equal height and width of screen

这篇关于UICollectionView 太宽.我怎样才能使它成为设备的宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆