automaticallyAdjustsScrollViewInsets
の機能をテストするための非常にシンプルなデモアプリケーションを作成しましたが、tableViewの最後のセルはタブバーで覆われています。 automaticallyAdjustsScrollViewInsets not working
UITabBarController *tabControl = [[UITabBarController alloc] init];
tabControl.tabBar.translucent = YES;
testViewController *test = [[testViewController alloc] init];
[tabControl setViewControllers:@[test]];
[self.window setRootViewController:tabControl];
マイtestViewController(の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;
}
これはiOSの7のバグですか?そうでなければ、私は何を間違えたのですか?
viewcontrollerのビューのサブビュー –
今すぐ確認しました。スクロールビューはビュー階層内でさらに深いので、UIWebViewでは面白いです。 – Rivera
インデックス0ビットの場合は+1、調整されていないWebビューで問題が発生したときに役立ちました。 –