Sunday, April 22, 2012

How to customize tableView seperator in iPhone


By default there is a single line separator in uitableview.



But I want to put my customized line as a separator.



Is it possible ? How ?



Thanks in advance for helping me.


Source: Tips4all

2 comments:

  1. If you want to do more than change the color of the separator using the separatorColor property of the UITableView then you could set the separatorStyle property to UITableViewCellSeparatorStyleNone and then either:


    create custom UITableViewCells that include your custom seperator within them
    create alternate UITableViewCells that include your custom separator


    For example, if your table currently displays 5 rows you could update it to display 9 rows and the rows at index 1, 3, 5, 7 would be separator cells.

    See Subclassing UITableViewCell in the Table View Programming Guide for more information on how to create custom UITableViewCells.

    ReplyDelete
  2. I dont know if this can be done "automatically" with some setting. But a suggestion would be to set the line separator as none, and in the borders of your cells actually draw your line separator that you want..

    ReplyDelete