Вопрос

How can I tell my UICollectionViewFlowLayout custom subclass to use a static, fixed item width value?

I would like my delegate to implement a custom method:

collectionView:layout:heightForItemAtIndexPath:

to return a variable item height, while the width is fixed. The width is calculated upon the collection view bounds and the section inset:

width = collectionView.bounds.width - sectionInset.left - sectionInset.right

I have created a custom UICollectionViewLayout subclass, but it gives me, unsurprisingly, a poor performance, so I'm looking forward to subclass the flow layout instead.

And don't tell me about UITableView. I know it exists.

Это было полезно?

Решение

Okay, I ended up by subclassing UICollectionViewLayout, thus fixing ald the bad performance issues.

However, if someone eventually comes up with an answer to my question, I will gladly accept it.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top