Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在情节提要中使用自动布局来定位 UICollectionView。我在顶部布局指南和 CollectionView 之间创建了一个垂直间距。但是集合视图仍然从导航栏下方开始。甚至原型单元也有额外的填充。请看下面的图片。
界面生成器:
模拟器视图:
内容应该从导航栏下方开始,但随着用户滚动,内容应该在导航栏下方。我该如何做到这一点?
在您的故事板中,转到 View Controller 属性,并确保未选中 Under Top Bars 选项。
同样在大多数情况下,您希望拥有不透明的导航栏。