2

I am creating tableView programmatically i want to set tableView style group but how to give that tableView alloc has only frame how we can set this values.

rob mayoff
  • 375,296
  • 67
  • 796
  • 848
user1567956
  • 131
  • 2
  • 6
  • 13

3 Answers3

6

refer a following code.

UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0,your_width,your_height) style:UITableViewStyleGrouped];
bitmapdata.com
  • 9,572
  • 5
  • 35
  • 43
2

you can programmatically add it by this way

tableView = [[[UITableView alloc] initWithFrame:CGRectMake(0,0,320,460) style:UITableViewStyleGrouped] autorelease];
tableView.dataSource = self;
tableView.delegate = self;

[self.view addSubview:tableView];
sujith1406
  • 2,822
  • 6
  • 40
  • 60
1

I am not sure, whether I understood your question in the right way, but you can construct a groupe tableView in this way:

UITableView* tview = [[UITableView alloc] initWithFrame:yourFrame style:UITableViewStyleGrouped];
Matthias
  • 8,018
  • 2
  • 27
  • 53