0
A
回答
0
首先,你應該建立在Xcode項目概要支持的接口方向的所有方向。然後在您的appDelegate:
- (NSUInteger) application: (UIApplication*) application supportedInterfaceOrientationsForWindow: (UIWindow*) window
{
NSUInteger orientations = UIInterfaceOrientationMaskAll;
if (self.window.rootViewController)
{
UIViewController* rootViewController = self.window.rootViewController;
UIViewController* presented;
if ([rootViewController isKindOfClass: [UINavigationController class]])
{
presented = [[(UINavigationController*) rootViewController viewControllers] lastObject];
}
else
{
presented = (UIViewController*) rootViewController;
}
orientations = [presented supportedInterfaceOrientations];
}
return orientations;
}
然後在每個UIViewController中:
- (NSUInteger) supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
中,你需要,你應該從UIInterfaceOrientationMaskPortrait改變UIInterfaceOrientationMaskLandscapeLeft或其它其它的方向。
相關問題
- 1. 強制UIViewController處於橫向模式iOS7
- 2. 在橫向模式下鎖定特定的UIViewController +強制橫向模式
- 3. 在橫向中強制UIViewController
- 4. 強制UIViewController只顯示在橫向模式
- 5. UIViewcontroller在橫向模式下保持縱向座標
- 6. 兩個橫向模式
- 7. 強制UIViewController全屏和橫向
- 8. UIViewController以橫向模式呈現時無法正常顯示
- 9. 在橫向模式下顯示故事板UIViewController
- 10. 在橫向模式下調用UIViewcontroller時出現UIScrollview錯誤
- 11. 橫向佈局不能在橫向模式下工作
- 12. 強制UIAlertView進入橫向模式
- 13. AS3 - iOS強制橫向模式?
- 14. 橫向模式下的tabbar控制器
- 15. UINavigation控制器不以橫向模式
- 16. 1日的ViewController在縱向和SecondViewController在橫向模式
- 17. iPad 1顯示縱向模式而不是橫向
- 18. 如何在橫向模式下製作ipad應用程序
- 19. 在橫向模式下製作iOS應用程序
- 20. 不能我的UIViewController限制爲橫向或縱向
- 21. 橫向模式打印一個GridView
- 22. Simperium登錄橫向模式
- 23. MFSideMenu橫向模式問題
- 24. UIAlertView在橫向模式
- 25. 只在橫向模式
- 26. iPhone橫向模式問題
- 27. MFMailComposer不IO6橫向模式
- 28. ImageView在橫向模式下
- 29. 在橫向模式下
- 30. printPreview橫向模式inC#
謝謝 - 我添加了代碼,但它似乎沒有什麼區別。我允許在界面中的所有方向總結,然後按照你說的添加,但沒有工作......缺少什麼? – Omar
我創建了示例項目。你可以檢查它https://github.com/SKrotkih/TestRotations – stosha