My Tabview controller has a tableview appearing as the first and initial view. The view controller class is a subclass of uitableviewcontroller, so I am not using XIB for this. Since I am giving the view name directly in the interface builder for the MainWindow of the tab view, I am not sure where I can set the style of the tableview, which appears in 'plain' style at the moment. I want to change it to 'grouped', however there is no code where I call and allocate the tableview controller (in which case I would have used the initWithStyle).
Any ideas on how I can change this initial tableview to grouped style instead of plain style?
I also tried overriding the initWithStyle and set it like below, but does not work.
- (id)initWithStyle:(UITableViewStyle)style {
// Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
self = [super initWithStyle:UITableViewStyleGrouped];
if (self) {
// Custom initialization.
}
return self;
}
Thanks,
Try the following then:
UITableView* table = [[UITableView alloc]initWithFrame:myFrame style:UITableViewStyleGrouped];
Replace UITableView
by the name of your custom class
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