2012-12-18 30 views
1

我無法在我的iPhone 5中旋轉我的視圖PortraitUpsideDown。我在項目摘要中使用了supportedInterfaceOrientations(UIInterfaceOrientationMaskAll)shouldAutorotate {return YES;},並且還檢查了PortraitUpsideDownIphone 5,UIInterfaceOrientationPortraitUpsideDown

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) 
     { 
      self.ViewController = [[ViewController alloc]initWithNibName:@"ViewController" bundle:nil]; 
      self.navigationController=[[UINavigationController alloc] initWithRootViewController:ViewController]; 
     } 

我已經使用[self.window setRootViewController: self.navigationController]。據工作都好於iPhone 4S,但不是在iPhone 5

+0

plz幫助我在我巨大的混亂........ –

回答

0

雖然這不會滿足你的問題,我必須補充一點:

你永遠不應該讓一個iPhone或iPod Touch旋轉「顛倒「,永遠。

只有iPad應該被允許這樣做。

爲什麼?

因爲這些設備不提供橫向鎖定按鈕,但僅適用於肖像。

現在想象你躺在你的牀上或沙發上,並且想要使用支持縱向和橫向模式的iOS應用程序。想象一下你想在橫向模式下使用這個應用程序。但是一旦你躺在一邊,iPhone會保持直立,並且會旋轉到Portrait或UpsideDownPortrait。除非應用程序阻止Upsidedown模式,否則無法將其鎖定到風景中!

因此,只讓iPad進入UIInterfaceOrientationPortraitUpsideDown,而不是其他設備,讓用戶在側臥時鎖定iPhone進入橫向模式。