iOS add a CollectionView to a another view within

2019-07-23 15:46发布

Just getting started with iOS, and trying to make the collection view on the right be a child view of the view on the left. I cant seem to drag it in. I think part of the problem is that on the left hand part of the nav (immediate left of the work area) the collection view is being called a scene. To create the view into which I want to put the collection view, I just dragged a new view controller into the work area, then did the control+click to add it to the main tab view. I am going to want another view above the collection view, but first things first...

Do I have to do this programmatically?

enter image description here

1条回答
何必那么认真
2楼-- · 2019-07-23 16:16

UICollectionView inherent from UIScrollView:UIView, so you can add in your IB or in code:

Like tableView, drag delegate and datasource to ViewController.If you want more collectiotionView, create more flowlayouts.

查看更多
登录 后发表回答