I have an object of size UICollectionView size (320 500).
I need to create a UICollectionView so that the content is vertically centered. So, if the total size of the content is (100 100), then the cells should be drawn in the rectangle (0,200): (320 300). i.e. 50 above and 50 below the vertical center by 250.
Problem. The number of cells and the size of cells is determined only at runtime. For example, if the text with a cell can be 1 line, the size is ~ (100.50). If the size of 4 lines is ~ (100,200). So only after I launched collectionView:sizeForItemAtIndexPath: for the last cell, I can determine what the starting position for the first cell should be.
Any initial suggestion on how I should approach this issue. Even if I'm a subclass of Flowlayout , how do I know the position of the first cell before I draw the last?
ios uicollectionview uicollectionviewlayout
ila
source share