设置UICollectionView和UICollectionViewCell的约束,但显示不正确 [英] set the constraint of UICollectionView and UICollectionViewCell but does not display correctly
问题描述
设置UICollectionView和UICollectionViewCell的约束,但不能正确显示
set the constraint of UICollectionView and UICollectionViewCell but does not display correctly
UICollectionView
UICollectionView
UICollectionViewCell
UICollectionViewCell
显示
UICollectionViewCell确实适合屏幕宽度
UICollectionViewCell does fit the screen width
Yourc全方位的欢迎
Yourc ommetnwelcome
推荐答案
是的.因为它的Xib....您可以为xib对象创建约束...但是xib边缘呢....您需要为您的xib提供高度和宽度限制以消除此问题...它只是以xib的高度和宽度放置在您的视图中...在您的情况下为(340,325)...您必须使其屏幕宽度和高度,你想要什么
Yes...because its Xib....you can create constraints to the xib objects...but what about xib edges....you need to give height and width constraints to your xib to get rid of this...It just placed in your view with xib height and width...in your case it is (340,325)...you have to make it screen width and height what ever you want
这篇关于设置UICollectionView和UICollectionViewCell的约束,但显示不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!