UICollectionView布局问题 [英] UICollectionView Layout Issue

查看:111
本文介绍了UICollectionView布局问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用流布局使用 UICollectionView
我为此做了一个自定义 UICollectionViewCell
但是在运行项目时,控制台继续抛出此错误 -

I am using UICollectionView using the flow layout. I have made a custom UICollectionViewCell for the same. But on running the project the console keeps on throwing this error-

UICollectionViewFlowLayout的行为未定义因为:
项目高度必须小于 UICollectionView 的高度减去该部分的顶部和底部值。

the behavior of the UICollectionViewFlowLayout is not defined because: the item height must be less that the height of the UICollectionView minus the section insets top and bottom values.

我已确保单元格的大小正确

I have made sure that the size of the cell is correct

是否有人能够解决此问题。
提前致谢。

Has anyone been able to resolve this issue. Thanks in advance.

问候
Nitesh

Regards Nitesh

推荐答案

我发现,使用故事板,你必须进入故事板并点击整体查看控制器(视图应以蓝色突出显示)并转到属性检查器(右侧第四个选项卡)屏幕)并取消选中Under Top Bars,Under Bottom Bars和Under Opaque Bars。这为我解决了这个问题,它也为我的同事清除了它。

I found that, using storyboards, you have to go into the storyboard and click on the overall View Controller (the view should be highlighted in blue) and go to the Attributes Inspector (the fourth tab on the right side of the screen) and unchecking the "Under Top Bars", "Under Bottom Bars", and "Under Opaque Bars." This cleared up the issue for me, and it cleared it for my coworkers as well.

这篇关于UICollectionView布局问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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