Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove corner shadow/offset in grouped UITableView

When a UITableView of type UITableViewStyleGrouped has a background view that is a non-default color or pattern image on the iPad, the rounded corners have an ugly extra line, sort of like a bevel effect or drop shadow:

ugly table view corners

Does anyone know of any way to get rid of the extra line at the bottom of the table?

like image 348
marcprux Avatar asked May 21 '11 03:05

marcprux


3 Answers

The default separator style for iPad is UITableViewCellSeparatorStyleSingleLineEtched. This is different from the iPhone's default of UITableViewCellSeparatorStyleSingleLine.

If you would like to remove the bevel, set the separatorStyle of the view to UITableViewCellSeparatorStyleSingleLine.

Note that the default separator style in iOS 5 for both devices is SingleLineEtched.

like image 103
Jeevan Takhar Avatar answered Oct 15 '22 04:10

Jeevan Takhar


I had the same problem when using [UIColor scrollViewTexturedBackgroundColor]. I managed to remove the "bevel effect" / "drop shadow" by using the code below:

self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

like image 2
user875330 Avatar answered Oct 15 '22 04:10

user875330


I replaced the tableView's backgroundView with a new view.

I then relied on the tableView's backgroundColor property to set the color I wanted:

self.tableView.backgroundView = [[[UIView alloc] init] autorelease];
self.tableView.backgroundColor = [UIColor whiteColor];
like image 1
Cristy Avatar answered Oct 15 '22 04:10

Cristy