2011-12-12 44 views
0

如何在didLoad中使用以下方法或者在iPad模擬器中使用willAppear時,設備總是在橫向模式下認爲它處於縱向模式時。在啓動時確定iPad的方向

UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];  
NSLog(@"orientation - %i", UIInterfaceOrientationIsPortrait(orientation)); 

這在iPhone模擬器中正常工作,有沒有另一種方法來找出設備的方向?

我已經嘗試在app.plist中添加支持的方向,但仍然模擬器認爲它在橫向模式?

乾杯,

回答

相關問題