When using the iOS 6 SDK and running my app in the iPhone 5.0 simulator my tableview appears just fine as a grouped style tableview. However when I run my in the iPhone 6.0 simulator it appears as a UITableViewStylePlain tableview.
Any ideas what would cause this strange behavior? I'm not doing anything too crazy in the tableview besides a textview inside a tableview cell.
I have a grouped tableview that is working correctly in iOS6 using the code:
tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0,self.bounds.size.width,self.bounds.size.height) style:UITableViewStyleGrouped];
[tableView setDataSource:self];
[tableView setDelegate:self];
Are you using the Interface builder to create this grouped tableview or are you creating it programmatically? There seems to be quite a few issues with iOS6 and previously created interfacebuilder views.
If you are using the IB to create things can you try to re-create the tableview in code (redundant and useless, I know, but it may show what is the problem).
Somewhere in your viewDidLoad() function put
if(tableView)
{
[tableView removeFromSuperview];
}
tableView = [[UITableView alloc] initWithFrame:tableView.frame style:UITableViewStyleGrouped];
[tableView setDataSource:self];
[tableView setDelegate:self];
[self addSubview:tableView];
This may be poor coding or cause memory leaks if not using arc, but it would be interesting to see if you get a grouped styling that way.
This code solved the ios6 grouped tableview problem for me:
tableView.backgroundColor = [UIColor clearColor];
tableView.opaque = NO;
tableView.backgroundView = nil;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With