标签:
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)
标签:
原文地址:http://www.cnblogs.com/argenbarbie/p/5863669.html