UItableView style not changing. I have a tableView controller as one of the tabs of my tab bar controller. I am not able to change the style of UItableView to grouped.
Please help,
UItableView style not changing. I have a tableView controller as one of the tabs of my tab bar controller. I am not able to change the style of UItableView to grouped.
Please help,
You can probably do that in your UITableViewControllers -viewDidLoad method.
self.tableView.style = UITableViewStyleGrouped;
Edit:
It seems the style property is actually read only, so the above won't work.
It looks like the table view controller has to be created with -initWithStyle:, but I don't know how to do that from Interface Builder. I'm not at my Mac right now, but will have a look later.
Edit 2:
Here's what I did in Interface Builder:
UITableView and set it up as required, including the styleUITableViewController as the delegate and data source of the UITableViewUITableView with the view outlet of the UITableViewController. I'm not sure if there is a tableView outlet - if there is, then probably connect it with that one instead.So, basically, instead of letting the UITableViewController create its own table view, you provide one in the xib and set up the required connections (delegate, data source, outlet) manually.
You must specify the Tableview's style upon creation. Either in IB or by using the method
tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0,320,416) style:UITableViewStyleGrouped];
I would create a new tableViewController and make sure to enable the "also create xib"-like option when giving the tableviewcontroller a name. Copy paste all youre old tablviewcontroller code to the new one and add the xib to the tab window..