的視圖控制器在問題被嵌入在UINavigationController
和呈現爲.FormSheet
像這樣:覆蓋港前賽績尺寸類
class PLViewController:UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
navigationController?.navigationBar.translucent = false
}
/// Embeds self into a UINavigationController, adds a "done" button to the navVC and uses the passed ViewController to present self embedded in the NavigationController.
/// - Parameters:
/// - presentingVC: ViewController which will present the formSheet.
/// - animated: If TRUE, the presentation of the formsheet will be animated.
func presentAsFormSheet (presentingVC:UIViewController, animated:Bool, completion:(() -> Void)?) {
let navVC = UINavigationController(rootViewController: self)
navVC.modalPresentationStyle = .FormSheet
let doneButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Done, target: self, action: Selector("dismissFormSheet"))
doneButton.tintColor = GlobalVars.cautionColor
navigationItem.setLeftBarButtonItem(doneButton, animated: false)
presentingVC.presentViewController(navVC, animated: true, completion: completion)
}
/// Dismisses this ViewController with animation from a modal state.
func dismissFormSheet() {
dismissViewControllerAnimated(true, completion: nil)
}
}
當VC在「浮動」港前賽績方式(非全屏模式)被呈現它需要基本上表現爲如下所示:
此外,佈局需要,如果應用程序是在任一1/3分割屏幕進行進一步操作(但不是三分之二的)或在iPhone上 一般來說。 iPhone部分很容易弄清楚,基本上檢查設備類型並在代碼中做出相應的響應。
是否有知道,在iPad上,a)在分屏模式和b)使用1/3,1/2或2/3?