你好,我有UIControllerView,我用下面的代码设置了UIEdgeInsets;
self.automaticallyAdjustsScrollViewInsets = false
self.collectionView.contentInset = UIEdgeInsets(top: 10, left: 10, bottom: 100, right: 10)我的ContentView码
let contentWidth = maxWidthInASection
let contentHeight = Double(collectionView!.numberOfSections())
self.contentSize = CGSize(width: Double(contentWidth), height: contentHeight)
self.contentSize.height = CGFloat(Double(collectionView!.numberOfSections()))但是不工作,用户没有选择底部cells,所以当用户滚动自动进入底部单元格时,我需要添加底部填充大小的50- 100 px,就像空区域一样。
二是;
当用户在集合视图第一次打开后滚动集合视图单元格时,我想禁用它,如果用户触摸并移动任何地方的集合视图,必须停留在那里,不首先进行定位?
下面是我的底座填充物样品

我该怎么做呢?
谢谢!
发布于 2016-08-23 12:14:15
let flow: UICollectionViewFlowLayout = CollectionView.collectionViewLayout as! UICollectionViewFlowLayout
flow.sectionInset = UIEdgeInsetsMake(70, 0, 0, 0)发布于 2016-08-23 12:13:55
你应该计算高度。对于更大的屏幕,可以看到更多。所以它不会自动这么做。
https://stackoverflow.com/questions/39100606
复制相似问题