I have a situation where I need to display a picker control in Xamarin like the following way.
它将并排显示国家国旗和国家代码。
所选的国家/地区代码应显示为选取器控件的背景图像。 (如图所示)
我刚刚开始Xamarin
发现Picker没有ItemSource
像 WPF XAML 这样的属性,它不支持DataTemplate
too.
Using a listView
我可以做到这一点,但是ListView
Control 和 Picker 控件的可用性不同。
谁能指导我如何在 Picker 中实现此功能Xamarin-XAML
?
Picker.Items
is an IList<string>
所以我认为你不能这样做,因为它只能容纳字符串。看:https://developer.xamarin.com/api/property/Xamarin.Forms.Picker.Items/ https://developer.xamarin.com/api/property/Xamarin.Forms.Picker.Items/
但是,您可以创建另一个页面,并在该页面上放置一个ListView
这样用户就可以在那里设置语言。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)