0
ステータスバーとモーダルビューの間にギャップがあるのはなぜですか?誰かがこれを使ってステータスバーとモーダルビューのギャップを取り除くのを助けてくれますか?ステータスバーとモーダルビューのギャップ
UIButton *button = [UIButton buttonWithType:UIButtonTypeInfoLight];
[button addTarget:self action:@selector(displayModalViewaction:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *infoItem = [[UIBarButtonItem alloc] initWithCustomView:button];
- (void)displayModalViewaction: (id) sender
{
self.viewController = [[Infoviewcontroller alloc] init];
UINavigationController *navigationController=[[UINavigationController alloc] init];
navigationController.navigationBar.tintColor = [UIColor brownColor];
[navigationController pushViewController:_viewController animated:YES];
[self.view addSubview:navigationController.view];
}
私に手伝ってくれてありがとうございました。ビューのフレームサイズ
[self.view setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
を添加することにより
ありがとう、これは正しい方法で私をもたらした。私の場合は 'UIScrollView'内に' UINavigationController'があり、ナビゲーションコントローラはビューコントローラがモーダル表示された後にステータスバーをオーバーラップしました。私は 'viewWillAppear'で' UIViewController'内の 'UINavigationBar'を20ピクセル下に移動しています。 –