2011-04-11 6 views
0

UINavigationController를 사용하여 내 cocos2d 뷰 위에 놓으면 (모든 것이 기본적으로 가로 방향입니다) 전체 화면을 채우지 않습니다. 사이징은 기본적으로 마치 세로 모드와 같습니다. 나는 그것을 fgirue하려고 노력하는 시간을 보냈다. 그리고 그것은 나를 미치게하고있다. 어떤 아이디어?UINavigationController 뷰가 화면을 채우지 않습니다.

프레임을 전체 크기로 설정하여 uiviewcontroller 및보기만으로이 작업을 수행 할 수있었습니다.

UIView* view = [[CCDirector sharedDirector] openGLView]; 

    sssRootViewController *rooviewController = [[[sssRootViewController alloc]init]autorelease]; 

     [[CCDirector sharedDirector] pause]; 
    StarTravelAppDelegate *appDelegate = (StarTravelAppDelegate *)[[UIApplication sharedApplication] delegate]; 

    rooviewController.view.frame = CGRectMake(0,0,480,320); 

    UINavigationController *navcontrol = appDelegate.myNavController; 

    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:rooviewController]; 
    navcontrol.view.frame = CGRectMake(0,0,480,320); 
    [view addSubview:navigationController.view]; 

    navcontrol.wantsFullScreenLayout = true; 
[view addSubview: navcontrol.view]; 

답변

0

먼저 응용 프로그램에 UIWindow를 추가 한 다음 해당 창에 네비게이션 컨트롤러를 추가 할 수 있습니다.

+0

이것이 작동하지 않습니다. – Mel

0
이 방법에 탐색 모음의 크기를 조정하려고 할 수

이 도움이 될이 희망

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
     // Overriden to allow any orientation. 
     if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight) { 
      // root view 
       self.view.frame = CGRectMake(0, 0, 480,320);  
       self.navigationBar.frame= CGRectMake(0, 175, 480,44);    

     } else { 
      // root view 
      self.view.frame = CGRectMake(0, 0, 320,480);  
      self.navigationBar.frame= CGRectMake(0, 175, 320,44);       
     } 

     return YES; 
    } 

플레이 행운

+0

이 메서드는 어떤 클래스에 있습니까? – Mel

+0

보기 컨트롤러에서 sssRootViewController 같은 –

+0

이 작동하지 않았다 – Mel

0

[[UIScreen mainScreen] applicationFrame]; 
에 프레임 속성을 설정 시도 되세요
+0

이 작동하지 않았다 – Mel

관련 문제