2012-01-10 3 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'를 20px 아래로 내리기로했습니다. –

관련 문제