2012-02-15 101 views

回答

1

變化

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 
    return (interfaceOrientation == UIInterfaceOrientationPortrait); 
} 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); 
} 

另外,還要確保在您的項目設置你 '支持的裝置定向' 設置爲允許景觀。

+0

不行!:(本當我只使用橫向方向時,Xcode輸入此代碼 – GeraldoBastos 2012-02-18 18:10:42

+0

@GeraldoBastos您是否在設置中啓用了橫向視圖?以上任何情況下都會觸發設備旋轉到任何位置e xcept肖像顛倒。 – Bot 2012-02-20 16:10:50

+0

是的!但不行。 – GeraldoBastos 2012-03-30 16:43:21

相關問題