Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

White Line at bottom of UITableView Cell at end of section in Grouped TableView (iOS 5)

I have noticed a change in the look of the tableview cells in iOS 5, and I googles around a bit to see if anyone else had noticed. This fellow did, and posted this image. I can't reproduce it on every uitableview (if I could I would know where it came from and I could get rid of it), but it is certainly causing me a problem on one of my tableviews. Has anyone else noticed this - better yet, has anyone else found a way to get rid of it?

like image 359
SAHM Avatar asked Oct 15 '11 21:10

SAHM


People also ask

How do I remove a separator from a table view?

Add a Plain UIView to the Footer of the UITableView First, grab a plain UIView from the object browser, and drag it to the the footer position below all of your cell prototypes. It worked! The separator lines are gone.

How do you remove the blank space at the top of a grouped UITableView?

You can change the space between tableviewcells themselves by: [myTableView setSectionHeaderHeight:0]; [myTableView setSectionFooterHeight:25];

How do I deselect a selected UITableView cell?

How to deselect a UITableViewCell using clearsSelectionOnViewWillAppear. If you set this property to be true the user's selected cell will automatically be deselected when they return to the table view.

How can we use a reusable cell in UITableView?

For performance reasons, a table view's data source should generally reuse UITableViewCell objects when it assigns cells to rows in its tableView(_:cellForRowAt:) method. A table view maintains a queue or list of UITableViewCell objects that the data source has marked for reuse.


2 Answers

I had this issue, on an iOS4 phone or simulator it looks fine but for iOS5 it was a problem. I discovered that the issue was with the separator style for the table view. It looks like the default value is set to etched for iOS5. I have gone through my code and added the following line to my init method for all grouped table view controllers:

    self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;

Which has fixed the issue for me, although I also set the following as the color appeared to be white not grey as in the previous version:

    self.tableView.separatorColor = [UIColor lightGrayColor];

It was a problem for me as I have changed the background on all of my table views and the extra line didn't look good for my app.

like image 109
simongking Avatar answered Sep 22 '22 20:09

simongking


use:

self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

like image 44
MobileMon Avatar answered Sep 24 '22 20:09

MobileMon