ios的旋屏控制技巧

2021-06-21 21:09:54 字數 426 閱讀 9461

在ios5.1 和 之前的版本中, 我們通常利用shouldautorotatetointe***ceorientation:來單獨控制某個uiviewcontroller的旋屏方向支援,比如:

- (bool)shouldautorotatetointe***ceorientation:(uiinte***ceorientation)inte***ceorientation

以後直接在工程的plist檔案中新增supported inte***ce orientations選項,新增item0 設定值為portrait 即可
如圖

iOS旋屏控制

自己在網上搜相關的資料時,看到很多地方說去控制 shouldautorotatetointe ceorientation 這個方法。然而這個方法在ios5以後就沒有用了。對於旋屏現在主要是這兩個方法 當前ios8 bool shouldautorotate nsuinteger supportedi...

iOS開發 戲說旋屏

橫豎屏切換,檢視亂了怎麼辦?首先,我們必須了解一下下列4種狀態,它們被用來描述裝置旋轉方向 uiinte ceorientationlandscapeleft 向左,即home鍵在右 uiinte ceorientationlandscaperight 向右,即home鍵在左 uiinte ceor...

iOS開發 戲說旋屏

橫豎屏切換,檢視亂了怎麼辦?首先,我們必須了解一下下列4種狀態,它們被用來描述裝置旋轉方向 uiinte ceorientationlandscapeleft 向左,即home鍵在右 uiinte ceorientationlandscaperight 向右,即home鍵在左 uiinte ceor...