iOS add a CollectionView to a another view within the storyboard UI builder

限于喜欢 提交于 2019-12-11 04:59:38

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/14289592/ios-add-a-collectionview-to-a-another-view-within-the-storyboard-ui-builder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!