2013-11-01 21 views

回答

2

在你AppDelegate.m文件集:

對於景觀

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window 
{ 
    return UIInterfaceOrientationMaskLandscape; 
} 

肖像:

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window 
{ 
    return UIInterfaceOrientationMaskPortrait; 
} 

對於兩種:

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window 
{ 
    return (UIInterfaceOrientationMaskAll); 
} 
+0

我需要縱向和橫向方向 –

+0

那麼你的問題是什麼?你問你如何爲應用設置界面方向。如果你想同時支持,那麼問題是什麼? –

+0

無論如何,編輯我的答案與代碼,以支持兩者。 –

相關問題