0

사용자가 iPhone에서 우리의 응용 프로그램을 사용하고 rootviewcontroller가 제공 한보기에서 호출을 받거나 탐색 컨트롤러를 덮고있는 중에 문제가 발생했습니다. 탐색 표시 줄. 통화의 상태 표시 줄은 현재보기를 표시 및 푸시하지만 해당보기가 수퍼바이저에서 제거되면 상태 표시 줄이 탐색 모음의 절반을 덮습니다.목표 C 탐색 모음이 StatusBar 변경시 조정되지 않음

우리는 앱 델리게이트에서 UIApplicationWillChangeStatusBarFrameNotification을 사용하고 탐색 컨트롤러와 탐색 바의 크기를 아무런 효과없이 조정하려고했습니다. 우리는 또한보기를 제공하는 페이지의 viewWillAppear 함수에서 탐색 컨트롤러 및 탐색 모음의 프레임을 재설정하려고했습니다.

어디에서 잘못 될지 알려줄 수 있습니까?

는 앱 위임에서 우리는 어떤 긍정적 인 결과와도 viewWillAppear 기능 관점에서 유사한이

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 
[self setupAppStyles]; 

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 
self.window.backgroundColor = [UIColor ugBlue]; 
UINavigationController *navController = [[UINavigationController alloc] init]; 
self.window.rootViewController = navController; 

[self.window makeKeyAndVisible]; 

[self setUpNotifications]; 

return YES; } 

-(void) setUpNotifications { 
[[NSNotificationCenter defaultCenter] addObserver:self 
             selector:@selector(statusFrameChanged:) 
              name:UIApplicationWillChangeStatusBarFrameNotification 
              object:nil];} 

- (void)statusFrameChanged:(NSNotification*)note { 
CGRect statusBarFrame = [note.userInfo[UIApplicationStatusBarFrameUserInfoKey] CGRectValue]; 
self.statusHeight = statusBarFrame.size.height; 

UIScreen *screen = [UIScreen mainScreen]; 
CGRect viewRect = screen.bounds; 

viewRect.size.height -= self.statusHeight; 
viewRect.origin.y += self.statusHeight; 

[[UINavigationBar appearance] setFrame:viewRect]; 

NSLog(@"The status frame has changed"); 

//[self.navController.view setFrame:viewRect]; 


self.navController.view.frame.size.height);} 

우리는 또한 시도 뭔가를 시도했다. 이견있는 사람?

답변

0

이 문제를 해결할 수있었습니다. 상태 표시 줄이 표시되면 presentViewController라고보기의 viewDidAppear에서 우리는

CGRect screenRect = [[UIScreen mainScreen] bounds]; 
    CGFloat navBarHeight = self.navigationController.navigationBar.frame.size.height; 
    CGRect frame = CGRectMake(0.0f, statusSize, screenRect.size.width, navBarHeight); 
    [self.navigationController.navigationBar setFrame:frame]; 

을 넣어