Claus
Claus

Reputation: 5742

Disabling separator for a specific UITableView section

I'm designing a Login page and I'm using a table with 3 section.

First section: 1 cell containing header image Second section: 2 cells for username and password Third section: 1 cell for login button.

3 section design

I would like to disable the separator for only for the 1st and 3rd section cells and leaving it active for the 2nd section. At the moment I can only enable/disable the separator for all the cells.

Any solution?

Thanks a lot

Claus

Upvotes: 0

Views: 1525

Answers (1)

JiaYow
JiaYow

Reputation: 5237

This might be a dirty way to do this, but you could disable the separators (as I don't think you can control them on a cell-level, but I could be wrong here), and draw the line manually?

You could, like, use a stretchable UIImage and put a gray pixel png into it, then stretch it to fill the cell width. This would allow you to even pick the color of the separator :-) Or just insert an UIView and set its backgroundcolor. Whatever you like.

Edit: On a side note, I'm not sure why you're using an UITableView anyway. You're not taking advantage of any feature of UITableView here (like scrolling, lazy loading, anything at all).

Upvotes: 1

Related Questions