I have subclassed the UITableView control, and the style is grouped, but I do not need the cell separators. I tried setting my table view's separatorStyle to none, but it doesn't work. Can any one help me out?
It appears that (a) the thinnest you can get s inline separators and (b) you can't change the style after you create the UITableView. From the docs:
Table View Style
The style of the table view.
typedef enum {
UITableViewStylePlain,
UITableViewStyleGrouped
} UITableViewStyle;
Constants
UITableViewStylePlain
A plain table view. Any section headers or footers are displayed as inline separators and float when the table view is scrolled.
Available in iPhone OS 2.0 and later.
Declared in UITableView.h
UITableViewStyleGrouped
A table view whose sections present distinct groups of rows. The section headers and footers do not float.
Available in iPhone OS 2.0 and later.
Declared in UITableView.h
Discussion
You set the table style when you initialize the table view (see initWithFrame:style:). You cannot modify the style thereafter.
This did the trick for me:
[dayTableView setSeparatorColor:[UIColor whiteColor]]; //or your background color
And in case you're using Interface Builder, select your UITableView and find "Table View Attributes" (press command-1).
At top you have "Table View" and under it as second item "Separator". Set it as "None". Can't get much easier than that!
In a grouped table view, setting separatorStyle
doesn't do anything. If you want to hide it, just do the following:
tableView.separatorColor = [UIColor clearColor];