4

How to Create iOS Table View like this??

When it scrolls, the background of the table view is static, so I think the table is made transparent, but how to create those horizontal separators??

screenshot

RRN
  • 1,127
  • 1
  • 12
  • 37

1 Answers1

1

You can add the horizontal separators to your cell background image. You can have a small image 1 pixel of height and the width of your cell, or even try to repeat it horizontally.

You can also add a line to the background view of your cell, instead of an image. See this thread for example to know how to add a line to a UIVIew: Draw line in UIView.

The important point is that you can probably achieve this by changing the background of the cell itself.

Community
  • 1
  • 1
J_D
  • 3,526
  • 20
  • 31
  • You mean those separators are actually a table cell? But the background is static, so edifying the cell is not the option here. – RRN Apr 18 '12 at 15:18
  • That would be a very simple way to do it, but probably not the only way. And if your table does not have enough cells to be filled entirely, you won't see horizontal separators after the last cell, because there won't be any cell, so there won't be any separator. – J_D Apr 18 '12 at 15:20
  • Also, the background of the table is static, it is probably the backgroundView property of the UITableVIew. The background of the cell may contain a line at the bottom the the rest is transparent. This way, when the table is scrolled, the background does not move but the separators follow the cells. – J_D Apr 18 '12 at 15:27
  • "The background of the cell may contain a line at the bottom the the rest is transparent" >> How this can be done?? – RRN Apr 18 '12 at 15:44