CollectionView不显示

问题描述 投票:1回答:2

正如你在下面我上传的第一张图片中看到的那样。我有3个段。在第一个段中,集合视图必须看起来像那样。但是,当我点击其他段时它必须消失。收藏视图必须在导航视图和内容之间另外,我上传了另一张图片,这是我的故事板。我在等你的帮助。谢谢!

The Design should be like that

Picture of my Storyboard

swift xcode uicollectionview storyboard
2个回答
0
投票

你需要实施

func collectionView(_ collectionView: UICollectionView, 
                  layout collectionViewLayout: UICollectionViewLayout, 
           sizeForItemAt indexPath: IndexPath) -> CGSize
   return CGSize(width:<#width#>,height:<#height#>)
}

0
投票

这个问题已经在stackoverflow上的另一个地方得到了回答

How to make a simple collection view with Swift

我认为这就是你需要知道的

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.