码迷,mamicode.com
首页 > 其他好文 > 详细

collectionView初始化

时间:2016-09-12 09:50:00      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:

collectionView初始化时已定要加layout。不然会报错:

UICollectionView must be initialized with a non-nil layout parameter.

        let layout = UICollectionViewFlowLayout()
        layout.scrollDirection = .horizontal
        layout.minimumInteritemSpacing = 5
        layout.itemSize = CGSize(width: 80, height: StoreDetailsViewController.headerHeight)

        self.collectionView = UICollectionView(frame: CGRect(x: 0, y: NavigationBarBaseController.barHeight, width: self.view.frame.width, height: StoreDetailsViewController.headerHeight), collectionViewLayout: layout)

 

collectionView初始化

标签:

原文地址:http://www.cnblogs.com/argenbarbie/p/5863669.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!