【问题标题】:Temporary extra space on top of UICollectionView w/ navigation bar带有导航栏的 UICollectionView 顶部的临时额外空间
【发布时间】:2018-08-02 04:16:04
【问题描述】:

我的 UICollectionView 和导航栏下的相应单元格存在一些问题。首先,当视图首次加载时,顶部似乎有一些额外的空间。但是当我向下滚动一点(不是完整滚动)时,它会调整到正常高度。查看下面的图片了解我的意思。 this is what I see when i first open the view controller

after a little scroll, not a full one (There are 10 cells in this VC), i see this. Why is this happening?

【问题讨论】:

    标签: swift uicollectionview uinavigationbar


    【解决方案1】:

    在您的视图控制器中取消选中调整滚动视图插图

    【讨论】:

    • 您可以尝试为集合视图设置 ContentInset 吗?
    【解决方案2】:

    在您的视图控制器中转到您的故事板,选择您的 collectionView,然后从侧窗格中选择尺寸检查器,有一个内容插入选项将其设置为从不。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多