0

I can easily set minimum item spacing to be 5 but I got another issue like this. Sometimes, spacing become larger. Instead of this behaviour, can I put 'aaaaaaaaa' in next line and the rest item still have spacing as 5.

enter image description here

Moin Shirazi
  • 4,372
  • 2
  • 26
  • 38
Khant Thu Linn
  • 5,905
  • 7
  • 52
  • 120
  • you have to calculate textsize of that label and according to that label size you have to increase cell size – Jitendra Modi Dec 08 '16 at 04:25
  • Thanks. I don't want to increase cell size. That margin is good. Somehow, my question relate to this one but I don't know how to solve too. http://stackoverflow.com/questions/13184883/justify-last-line-of-uicollectionview – Khant Thu Linn Dec 08 '16 at 04:26
  • I want to put white space after 'ASN' rather than having white space between 'Safety' , 'Incident' , etc. – Khant Thu Linn Dec 08 '16 at 04:27
  • I need to disable 'Justify' in my flow layout. How shall I do? – Khant Thu Linn Dec 08 '16 at 04:28
  • what is your default cell width ? – Jitendra Modi Dec 08 '16 at 04:28
  • Default is 30 but I am using self-sizing technique with autolayout. Each cell size is now fully occupied by label. The one we see white space are due to spacing. – Khant Thu Linn Dec 08 '16 at 04:30
  • you can manage cell spacing into inspector pane or as per above my suggestion you have to calculate text size of that label and returning width of cell according to that label width – Jitendra Modi Dec 08 '16 at 04:32
  • If you want fixed cell width, then your text will get truncated. Unless you want the **height** of the cell to increase and the label to become multiline? Right now all items should have spacing of 5 but number of items in each row will be different. – Rikh Dec 08 '16 at 04:34
  • you can Use Flow layout for collectionView – Dhiru Dec 08 '16 at 04:37
  • Yes. I am using flowlayout (setting minimum spacing as 5 already) but it is setting minimum spacing. My case is different. – Khant Thu Linn Dec 08 '16 at 04:40

0 Answers0