uicollectionviewcell - UICollectionView, UICollectionViewFlowLayout: different cells width and same defined spacing between cells -
i have overloaded uicollectionviewflowlayout have single horizontal row slider containing uiimages in each uicollectionviewcell.
in overloaded uicollectionviewflowlayout, have set minimumlinespacing 0 no spacing between uicollectionviewcells. (default 10px)
in case each cell has same width, 0px spacing correctly displayed
in case cell has bigger width, 0px no more taken account , default 10px between cells applied..
i have tried implement following method same result...
- (cgfloat)collectionview:(uicollectionview *)collectionview layout:(uicollectionviewlayout*)collectionviewlayout minimumlinespacingforsectionatindex:(nsinteger)section { return 0.0; } - is bug ?
- what "trick" 0px spacing between
uicollectionviewcellsdifferent width ?
is bug? no
not bug, default behavior ofuicollectionviewflowlayout. flow layout line breaking layout means assume place cells along straight line , going arrange on screen. once fill row(no space new item), break line , go next.uicollectionviewflowlayoutassures minimumlinespacing no exact. if item sizes different flow layout arranges cells in such way keep minimum line spacing. line size may increase never lower value set previously.
i dont think possible flow layout, should use 1 custom layout. check this iam not sure can set spacing 0 give try
jsprintdemo
Comments
Post a Comment