Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我从一个以编程方式实现的 UICollectionView 得到这个:
有没有办法(以编程方式)要求它从左到右而不是从上到下计数,以便有两行四行而不是两列?谢谢!
如果您使用的是流布局,您可以将UICollectionViewFlowLayout'scrollDirection属性设置为UICollectionViewScrollDirectionVertical:
UICollectionViewFlowLayout
scrollDirection
UICollectionViewScrollDirectionVertical
UICollectionViewFlowLayout *layout = collectionView.layout; layout.scrollDirection = UICollectionViewScrollDirectionVertical;