在 swift ui 中找不到 PopUpButtonPickerStyle

Cant find PopUpButtonPickerStyle in swift ui

我想为我在表单中使用的选择器使用 PopUpButtonPickerStyle,但它对我来说不存在。 Apple 文档中的任何其他 PickerStyle 都有效。

有谁知道是什么原因造成的?

Apple Documentation 中可以清楚地看出,PopUpButtonPickerStyle 仅在 macOS 10.15+ 上可用,在 iOS 上不可用。

因为你用“ios”标签标记了你的问题,我假设你确实在构建 iOS 应用程序,因此你不能使用它。