2011-06-11 71 views
0

我正在將iPhone應用更新爲通用。 我有不同的視圖控制器與XIB文件,當在實際視圖切換到橫向視圖調整大小完美時,在縱向模式的這些視圖之間導航時,所有工作都很好。在橫向模式下切換視圖時Xcode通用應用問題

但是,當設備停留在橫向並導航到其他視圖(xib)時,新視圖打開顯示就像縱向模式,並且沒有調整大小,視圖不在屏幕上,而在右側部分,我可以查看最後一個視圖的一部分。我認爲我沒有使用正確的方法來調用一個新的視圖控制器,看起來像是創建一個新的層。

那麼,當設備處於橫向和縱向時,是否可以通過自動調整大小來正確切換視圖?

關於我的項目的更多信息:

我代表

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:[[IntroViewController alloc] initWithNibName:@"IntroViewController" bundle:nil]]; 
[navController setNavigationBarHidden:YES]; 
[window addSubview:navController.view]; 
[window makeKeyAndVisible]; 

的方法來調用一個觀點:

-(IBAction)actioncontact:(id)sender{ 
    Contactpage *listing = [[Contactpage alloc] initWithNibName:@"Contactpage" bundle:nil]; 
    self.contpage = listing; 
    [listing release]; 
    [self.view addSubview:contpage.view]; 
    CATransition *animation = [CATransition animation]; 
    [animation setType:kCATransitionFade]; 
    [animation setSubtype:kCATransitionFromRight]; 
    [animation setDuration:0.25]; 
    [[self.view layer] addAnimation:animation forKey:@"transitionViewAnimation"]; 
} 

預先感謝您的回答。

回答

1

,我發現我的問題的方法是錯誤的,我用本模態和它的作品:

-(IBAction)actioncontact:(id)sender{ 

Contactpage *listing = [[Contactpage alloc] initWithNibName:nil bundle:nil]; 
listing.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; 
[self presentModalViewController:listing animated:YES]; 
[listing release]; 

} 
相關問題