12
如何在iOS 8中正确显示弹出框
我正在尝试将UIPopoverView添加到我的Swift iOS 8应用程序中,但是由于弹出框未以正确的形状显示,因此无法访问PopoverContentSize属性。我的代码: var popover: UIPopoverController? = nil func addCategory() { var newCategory = storyboard.instantiateViewControllerWithIdentifier("NewCategory") as UIViewController var nav = UINavigationController(rootViewController: newCategory) popover = UIPopoverController(contentViewController: nav) popover!.setPopoverContentSize(CGSizeMake(550, 600), animated: true) popover!.delegate = self popover!.presentPopoverFromBarButtonItem(self.navigationItem.rightBarButtonItem, permittedArrowDirections: UIPopoverArrowDirection.Any, animated: true) } 输出: 当我通过UIPopoverPresentationController做同样的事情时,我仍然没有完成它。这是我的代码: func addCategory() { var popoverContent = self.storyboard.instantiateViewControllerWithIdentifier("NewCategory") as UIViewController …