2012-05-02 44 views
0

在我們的應用中,第一次我們的應用處於縱向模式。 如果設備處於橫向模式,則會顯示縱向畫面模式。爲什麼? 但是當我手動旋轉模擬器,然後它將正確進入橫向和縱向模式。 但首次模擬器顯示豎屏.. 請解決我的煩惱是爲什麼這會發生,或如何解決它..如果設備處於橫向模式,第一次應用處於縱向模式

+1

「租賃解決我的問題,爲什麼這是發生或如何解決它..」當然,哥們。 – Peres

回答

0

你必須支撐取向添加到Xcode中的應用。

enter image description here

如果不行你可以添加以下到您的viewController

注:此代碼表示,應用程序支持每一個方向,除了UIInterfaceOrientationPortraitUpsideDown當設備是iPhone或iPod Touch,並且可以進行修改以適應設備和iPhone/iPad時的特定方向要求。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { 
     return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); 
    } else { 
     return YES; 
    } 
} 
相關問題