2010-04-02 2 views
0

사용자 정의 UIViewController 뷰를 추가 한 후에이 차이가 내 창 아래쪽에 표시됩니다. 내가 다른보기로 이동 한 다음 뒤로 이동하면보기가 아래로 이동함에 따라 간격이 사라집니다.사용자 정의 UIViewController를 창에 추가 할 때 간격을 제거하는 방법은 무엇입니까?

- (void)applicationDidFinishLaunching:(UIApplication *)application {  

    // Override point for customization after application launch 
    CustomViewController *gvc = [[CustomViewController alloc] init]; 
    self.customViewController = gvc; 
    [gvc release]; 

    [window addSubview:customViewController.view]; 
    [window makeKeyAndVisible]; 
} 

"CustomViewController"간단히 표시 할 수있는 다른 UIViewControllers 조정하는 루트 뷰 컨트롤러로서 사용된다 : 여기

앱 델리게이트의 코드이다. 따라서 단순히과 같이 필요한 첫번째의 ViewController의 관점의에 = 해당 뷰를 설정 :

- (void)loadView { 
    UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; 
    self.view = v; 
    [v release]; 

    // Add the HomeViewController to the top of the stack 
    MainViewController *mvc = [[MainViewController alloc] initWithNibName:@"MainView" bundle:nil]; 
    mvc.delegate = self; 
    self.mainViewController = mvc; 
    [mvc release]; 

    [self.view addSubview:self.mainViewController.view]; 
} 

난 당신이 행운으로 여기에 표시되는 내용을 포함하여 일의 무리를 시도했습니다. 어떤 아이디어?

감사

답변

0

UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; 

이 있어야 할이 줄 ...

UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 20, 320, 460)]; 

좋은 시절.

관련 문제