iphone 上不显示弹出框
popover doesn't display on iphone
我遵循了这个 但没有在 iphone 上生成弹出窗口。
这是 viewcontroller
的代码
class ViewController:UIViewController,UIPopoverPresentationControllerDelegate{
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "second"{
let secondVC = segue.destination
let controller : UIPopoverPresentationController = secondVC.popoverPresentationController!
controller.delegate = self
}
}
/* Popover delegate method */
func adaptivePresentationStyleForPresentationController(controller: UIPresentationController) -> UIModalPresentationStyle {
return UIModalPresentationStyle.none
}
}
我无法在 iphone 中使用 present 作为弹出框来显示新的 viewcontroller。 (ios 10/xcode8)
After clicking on button secondViewController should popover on that button.
使用此委托方法后,它会在 iphone 上生成弹出窗口。
func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle {
return UIModalPresentationStyle.none
}
我遵循了这个
class ViewController:UIViewController,UIPopoverPresentationControllerDelegate{
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "second"{
let secondVC = segue.destination
let controller : UIPopoverPresentationController = secondVC.popoverPresentationController!
controller.delegate = self
}
}
/* Popover delegate method */
func adaptivePresentationStyleForPresentationController(controller: UIPresentationController) -> UIModalPresentationStyle {
return UIModalPresentationStyle.none
}
}
我无法在 iphone 中使用 present 作为弹出框来显示新的 viewcontroller。 (ios 10/xcode8)
After clicking on button secondViewController should popover on that button.
使用此委托方法后,它会在 iphone 上生成弹出窗口。
func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle {
return UIModalPresentationStyle.none
}