Я пытаюсь создать представление программно. Результат, который я хочу иметь, - это просмотр прокрутки с внутренним просмотром таблицы. И под этим столом зрения я хочу, чтобы добавить некоторые кнопкиДобавить кнопки под таблицей
Я не знаю, как именно это сделать, что я попытался это, но он не работает:
- (void)loadView {
[super loadView];
tableView = [[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStyleGrouped];
[tableView setDelegate:self];
[tableView setDataSource:self];
scrollView = [[UIScrollView alloc] initWithFrame:[[self view] bounds]];
//[scrollView setBackgroundColor:[UIColor blackColor]];
[scrollView setBouncesZoom:YES];
deconnectButton = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
[deconnectButton setTitle:@"Deconect" forState:UIControlStateNormal];
[deconnectButton setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
//[deconnectButton addTarget:self action:action forControlEvents:UIControlEventTouchUpInside];
deconnectButton.frame = tableView.frame;
NSLog(@"Tableview frame : %@", NSStringFromCGRect(tableView.frame));
[scrollView addSubview:deconnectButton];
[scrollView addSubview:tableView];
[[self view] addSubview:scrollView];
}
Что я упускаю или делаю неправильно?