简体   繁体   中英

UICollectionView layout with custom layout

Is it possible to create a collection view with an item on the left and two items stacked to the right of it?

Whenever I specify the correct sizes to do this in the sizeForItemAtIndexPath delegate I can only get one item on the right side and the other is displayed in the next row underneath. I know I can do this with custom cells that contain more than one view (top and bottom) but I would like to know if its possible without that. It would be a lot less complex if I could do it without the custom double view cell. Im using a 'flow' layout with 'vertical' scroll direction (as per IB).

First image is what I hope to achieve and the second is what I am able to achieve currently.

我想做的事

发生了什么

您需要为此实现自定义UICollectionViewFlowLayout子类- 创建自定义布局

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM