如何设置UICollectionView 初始偏移

2025-05-17 05:19:02
推荐回答(1个)
回答(1):

_collectionView.contentInset = UIEdgeInsetsMake(-20, 0, 0, 0); // 向上偏移20;
和scrollview一样,设置IcontentInset的偏移量就行了