0
ここに私が使用したコードがあります。私は何が欠けていますか?トップにナビゲーションバーを持つテーブルビューを作成しようとしています
- (void)loadView
{
CGSize screen_size = [[UIScreen mainScreen] bounds].size;
CGFloat navBarHeight = 40;
UINavigationBar *nav = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, screen_size.width, navBarHeight)];
UITableView *table = [[UITableView alloc] initWithFrame:CGRectMake(0, navBarHeight, screen_size.width, screen_size.height - navBarHeight) style:UITableViewStylePlain];
table.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
table.delegate = self;
table.dataSource = self;
table.editing = YES;
[table reloadData];
[self.view addSubview:nav];
[self.view addSubview:table];
[nav release];
[table release];
}
下にテーブルがあるナビゲーションバーの代わりに、ステータスバーの下に黒い画面が表示されます。