你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> IOS設置窗口方向

IOS設置窗口方向

編輯:IOS開發綜合

IOS設置窗口方向

默許的IOS手機端支持三個方向:Portrait(豎直),Labdscape Left(左側橫擺,左側在上,右側在下),Landscape Right(右側橫擺,右側在上,左側在下)。

假如想讓窗口支持某個方向,則需求在控制器窗口中重載函數
-(UIInterfaceOrientationMask)supportedInterfaceOrientations

假如想要支持四個方向,則直接return UIInterfaceOrientationMaskAll;
或許
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown)

只支持向上方向,則直接輸出
return UIInterfaceOrientationMaskPortrait;

【IOS設置窗口方向】的相關資料介紹到這裡,希望對您有所幫助! 提示:不會對讀者因本文所帶來的任何損失負責。如果您支持就請把本站添加至收藏夾哦!

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved