一般的應用,只會支持豎屏正方向一個方向,支持多個屏幕方向的應用還是比較少的。
成都創新互聯于2013年成立,先為鹽邊等服務建站,鹽邊等地企業,進行企業商務咨詢服務。為鹽邊企業網站制作PC+手機+微官網三網同步一站式服務解決您的所有建站問題。不過我在工作的項目中,跟這個屏幕方向接觸比較多,因為我們是一個有界面的 SDK,要讓接入方接入的,一開始做沒什么經驗,考慮到接入方本身的屏幕方向可能是多種的,所以我們直接上來就支持四個方向,然后就是各種轉屏的問題,90度旋轉、180讀旋轉、270度旋轉,測試手都快轉斷了。
后來覺的根本沒必要,浪費了很多時間在解決屏幕方向的問題上,后來就簡化到讓接入方直接設置支持某個方向了。
一般的應用不用搞的這么的復雜,只要支持一兩個屏幕方向就可以了。我也做一下跟屏幕方向有關的幾點總結,希望能幫到一些開發者!
系統屏幕方向枚舉
通過查看文檔,用于控制系統屏幕方向的枚舉如下:
// iOS 6 之前用于控制屏幕方向的枚舉 typedef enum { UIInterfaceOrientationPortrait = UIDeviceOrientationPortrait, UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown, UIInterfaceOrientationLandscapeLeft = UIDeviceOrientationLandscapeRight, UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeLeft } UIInterfaceOrientation; // iOS 6 及之后版本用于控制屏幕方向的枚舉 typedef enum { UIInterfaceOrientationMaskPortrait = (1 << UIInterfaceOrientationPortrait), UIInterfaceOrientationMaskLandscapeLeft = (1 << UIInterfaceOrientationLandscapeLeft), UIInterfaceOrientationMaskLandscapeRight = (1 << UIInterfaceOrientationLandscapeRight), UIInterfaceOrientationMaskPortraitUpsideDown = (1 << UIInterfaceOrientationPortraitUpsideDown), UIInterfaceOrientationMaskLandscape = (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight), UIInterfaceOrientationMaskAll = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown), UIInterfaceOrientationMaskAllButUpsideDown = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight), } UIInterfaceOrientationMask;
另外有需要云服務器可以了解下創新互聯建站vcdvsql.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業上云的綜合解決方案,具有“安全穩定、簡單易用、服務可用性高、性價比高”等特點與優勢,專為企業上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
網站標題:淺談iOS屏幕方向那點事兒-創新互聯
分享路徑:http://vcdvsql.cn/article40/cdiieo.html
成都網站建設公司_創新互聯,為您提供外貿網站建設、軟件開發、微信公眾號、電子商務、自適應網站、商城網站
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯