我只是想在现有的主要的UIViewController / UIView的呈现一个小选项对话框,以便在iPad上我会看到一个小对话框,并在后台,我会看到主视图。
我设法在一个模式视图样式如下展现一个UIViewController / UIView的:
func showoptions(){
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let controller = storyboard.instantiateViewControllerWithIdentifier("Options") as! UIViewController
controller.modalPresentationStyle = UIModalPresentationStyle.Popover
let popoverPresentationController = controller.popoverPresentationController
// result is an optional (but should not be nil if modalPresentationStyle is popover)
if let _popoverPresentationController = popoverPresentationController {
// set the view from which to pop up
_popoverPresentationController.sourceView = self.view;
//_popoverPresentationController.sourceRect = CGRectMake(60, 100, 500, 500)
//_popoverPresentationController. .setPopoverContentSize(CGSizeMake(550, 600), animated: true)
//_popoverPresentationController.sourceView.sizeToFit();
// present (id iPhone it is a modal automatic full screen)
self.presentViewController(controller, animated: true, completion: nil)
}
}
但我仍然有一些问题:1 HOWTO摆脱在边境所示的箭头。 2.方法文档尺寸此模态的视图。 结果表明小,我想它适合在UIControllerView / UIView的最大控制。
任何帮助吗?