iPad開發最大的不同在于iPhone的就是螢幕控件的适配,以及橫豎屏的旋轉。
Storyboard中得SizeClass的橫豎屏配置,也不支援iPad開發。
在iOS7及以前得到螢幕旋轉方向的方法
在iOS8以後,螢幕就隻有螢幕之分,即當螢幕的寬大于高就是橫屏,否則是豎屏。
iPad螢幕隻有 (1024 * 768)橫屏
(768 * 1024)豎屏
UIModalPresentationFullScreen :全屏顯示(預設)
UIModalPresentationPageSheet
寬度:豎屏時的寬度(768)
高度:目前螢幕的高度(填充整個高度)
UIModalPresentationCurrentContext :跟随父控制器的呈現樣式
UIModalTransitionStyleCoverVertical :從底部往上鑽(預設)
UIModalTransitionStyleFlipHorizontal :三維翻轉
UIModalTransitionStyleCrossDissolve :淡入淡出
UIModalTransitionStylePartialCurl :翻頁(隻顯示部分,使用前提:呈現樣式必須是UIModalPresentationFullScreen)
UIModalPresentationCustom
UIModalPresentationOverFullScreen
UIModalPresentationOverCurrentContext
UIModalPresentationPopover //iOS8之後過渡樣式pop樣式
UIModalPresentationNone
建立UIPopoverController控制器的内容控制器添加到UIPopoverController上
<code>強調</code>UIPopoverController不是繼承UIViewController,也就不具備顯示功能,要設定内容,使用initWithContentViewController設定内容
設定popView的大小(預設控制器有多大就顯示多大)(120, 44 * 3)
UIPopoverController的方法popoverContentSize
内容控制器中設定的方法
self.preferredContentSize
self.contentSizeForViewInPopover /ios7過時/
調用方法
1>調用方法
2>控制器内,有自己的邏輯結構(和正常控制器一樣可以跳轉傳回等)
方法
1>masterViewController(主要控制器)
2>負責展示主要的菜單内容
1>detailViewController(詳情控制器)
2>負責展示詳細内容