次のコードを使用して、ビューにナビゲーション バーを追加しました。
- (void)viewDidLoad
{
[super viewDidLoad];
UINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
UINavigationItem *navItem = [[UINavigationItem alloc] initWithTitle:@"Load Colors"];
[navBar pushNavigationItem:navItem animated:NO];
UIBarButtonItem *editButton = [[UIBarButtonItem alloc] initWithTitle:@"Edit"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(toggleEdit:)];
navItem.rightBarButtonItem = editButton;
[self.view addSubview:navBar];
CGRect tableFrame = self.tableView.frame;
tableFrame.origin.y = tableFrame.origin.y +45;
self.tableView.frame = tableFrame;
}
下の図でわかるように、それは私のtableViewにあります.どうすれば修正できますか?