2012-01-10 11 views
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)]; 

を添加することにより

答えて

1

ステータスバーとモーダルビューとの間のギャップを固定されています。

+0

ありがとう、これは正しい方法で私をもたらした。私の場合は 'UIScrollView'内に' UINavigationController'があり、ナビゲーションコントローラはビ​​ューコントローラがモーダル表示された後にステータスバーをオーバーラップしました。私は 'viewWillAppear'で' UIViewController'内の 'UINavigationBar'を20ピクセル下に移動しています。 –

関連する問題