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 uicollectionviewcells different width ?

  1. is bug? no
    not bug, default behavior of uicollectionviewflowlayout. 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. uicollectionviewflowlayout assures 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.

    enter image description here

  2. i dont think possible flow layout, should use 1 custom layout. check this iam not sure can set spacing 0 give try
    jsprintdemo


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -