Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
切换到iPhone的popover在iOS 10中不工作?_Ios_Iphone_Ios10 - Fatal编程技术网

切换到iPhone的popover在iOS 10中不工作?

切换到iPhone的popover在iOS 10中不工作?,ios,iphone,ios10,Ios,Iphone,Ios10,我想在iOS 10中切换到popover,这段代码过去在iPhone上运行良好,但现在不行(它显示全屏),我做错了什么?segue设置为“作为Popover显示” Popover是iPad唯一的功能。 UIKit足够智能,可以在iPhone/iPod上以模式显示它。许多功能在Swift 3中被重命名,包括adaptivePresentationStyleForPresentationController-现在是adaptivePresentationStyle(for:) 将代码更改为 func

我想在iOS 10中切换到popover,这段代码过去在iPhone上运行良好,但现在不行(它显示全屏),我做错了什么?segue设置为“作为Popover显示”


Popover是iPad唯一的功能。
UIKit足够智能,可以在iPhone/iPod上以模式显示它。

许多功能在Swift 3中被重命名,包括
adaptivePresentationStyleForPresentationController
-现在是
adaptivePresentationStyle(for:)

将代码更改为

func adaptivePresentationStyle(for controller:UIPresentationController) -> UIModalPresentationStyle {
    return .none
}

由于您的函数名不匹配,因此未调用该函数,并且该函数是协议中的可选函数,因此未收到警告。

这是默认行为,但您可以通过
adaptivePresentationStyleForPresentationController
更改此操作。他们的问题似乎是“为什么这在iOS 10中不能像在早期版本的iOS中那样工作,我如何修复它?”很好的一个欢呼——可选协议方法有时会导致问题的原因之一:)这在iOS 11中停止工作了吗?我只能在iPhone上以模式显示popover
func adaptivePresentationStyle(for controller:UIPresentationController) -> UIModalPresentationStyle {
    return .none
}