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

查看:108
本文介绍了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天全站免登陆