Ajuste automáticamenteScrollViewInsets no funciona
He creado una aplicación de demostración extremadamente simple para probar la funcionalidad deautomaticallyAdjustsScrollViewInsets
, pero la última celda del tableView está cubierta por mi barra de pestañas.
Mi código de AppDelegate:
UITabBarController *tabControl = [[UITabBarController alloc] init];
tabControl.tabBar.translucent = YES;
testViewController *test = [[testViewController alloc] init];
[tabControl setViewControllers:@[test]];
[self.window setRootViewController:tabControl];
Mi código de testViewController (subclase de UITableViewController):
- (void)viewDidLoad
{
[super viewDidLoad];
self.automaticallyAdjustsScrollViewInsets = YES;
self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds];
self.tableView.dataSource = self;
self.tableView.scrollIndicatorInsets = self.tableView.contentInset;
//[self.view addSubview:self.tableView];
// Do any additional setup after loading the view.
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 20;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@""];
cell.textLabel.text = @"test";
return cell;
}
¿Es esto un error en iOS 7? Si no, ¿qué hice mal?