1

I want to know if there is a way to set the spacing between rows with static cells of tableview with storyboard.

I didn't find an attributor to do that:

enter image description here

I want to set the spacing between rows so it should like this:

enter image description here

armnotstrong
  • 8,605
  • 16
  • 65
  • 130

3 Answers3

6

You cannot do that. There are several options how you can deal with this.

  1. Simulate the separator in the cell itself (e.g., see my question).

  2. Use every other cell as a separator (so cell at row 0 will be normal cell, cell at row 1 will be a separator, cell at row 2 a normal cell, etc.).

  3. Use section footers as a separators, in that case there will be section per every cell - numberOfSections will return number of all cells, numberOfRows will return 1. Then use footerForSection to provide appropriate "separator".

Milan Nosáľ
  • 19,169
  • 4
  • 55
  • 90
0

Nothing in attribute inspector to do that , you can do it like that

contentView
     topView   ----- height(static) ---- white background
     spaceView ----- height (5) ---- gray background
Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87
0

Use UICollectionView

UITableView don't provide spacing between rows

Alexey Kudlay
  • 525
  • 2
  • 14