Xamarin Forms iOS - 具有多行选择的 PickerView

Xamarin Forms iOS - PickerView with Multi Row Selection

我正在使用选择器来显示项目,我想 select 选择器中的多行,有什么方法可以在 Xamarin Forms 共享代码中或通过渲染来实现吗?任何建议或想法将不胜感激。

谢谢。

不,没有。

Picker Class 有 SelectedIndex 属性,但没有 SelectedItems 集合。此外,iOS 后台的本机控件不支持选择多行,我认为 Android 或 Windows 也不支持。

如果有您想使用的本机控件,您可以创建使用 Custom Renderer。但是,使用 ListView 控件并添加一些事件并设置样式使其外观和行为符合您的要求可能会更容易。

我不会使用 Picker 进行多选。 您可以使用 ListView(100% XF 代码)执行此操作。
前段时间我在 XF 论坛 post编辑了一些代码:

http://forums.xamarin.com/discussion/17885/multiselect-listviews

如果您必须从 ScrollView 显示 "Multiselect-ListView",您可能也有兴趣使用 PopUp-Control (XLabs): https://forums.xamarin.com/discussion/33587/how-to-use-a-listview-in-a-scrollview-with-xlabs-popup-control#latest

最后,如果您想安装 XLabs-NuGet,进一步 posting XLabs 可能会对您有所帮助(在 XF 论坛中搜索 "How to install, setup and use XLabs")。
因为我在这里的代表点数不超过 10 个,所以我无法 post 超过两个链接 :-)

希望这对您有所帮助...