代码之家  ›  专栏  ›  技术社区  ›  Jake Dobson

CollectionView加载到视图后“重新调整”原点

  •  0
  • Jake Dobson  · 技术社区  · 8 年前

    我开始认为这可能是一个bug,因为包含文本字段、iMessage应用程序抽屉图标、心形图标和相机图标的标题栏似乎被截断的量与偏移量大致相同。

    enter image description here

    here is the code from github

    1 回复  |  直到 8 年前
        1
  •  1
  •   Jonas    8 年前

    contentInset 在您的 layout() 通话距离原始位置6像素。这就是为什么动画在动画完成后调整6像素。

    UIEdgeInsets() 在你的 呼叫内部 StickerCollectionVC

    self.collectionView?.contentInset = UIEdgeInsets(   top: screenW * 0.1 - 6,
                                                                left: screenW * 0.1,
                                                                bottom: 20 + (screenW * 0.1),
                                                                right: screenW * 0.1)
    
    推荐文章