0

我必须在 Xamarin 中集成一个用于移动注册的国家代码微调器。我已在微调器中成功插入所有国家名称,但我还想添加带有国家名称的标志和代码。

在此处输入图像描述

请为我提供在 Spinner 中添加带有标志和代码的国家/地区名称的最佳方法。我想要 C# 代码。

4

1 回答 1

0

在 Xamarin Forms 中没有 ComboBox(您的图像似乎是 ComboBox ...)。您可以像@Alex 建议的那样使用 Picker。否则,您可以使用 ListView 创建一个弹出页面。有一个很好的带有示例的插件

https://github.com/rotorgames/Rg.Plugins.Popup

这些是一些方法

// Use these methods in PopupNavigation globally or Navigation in your pages

// Open new PopupPage
Task PushAsync(PopupPage page, bool animate = true) // Navigation.PushPopupAsync

// Hide last PopupPage
Task PopAsync(bool animate = true) // Navigation.PopPopupAsync

// Hide all PopupPage with animations
Task PopAllAsync(bool animate = true) // Navigation.PopAllPopupAsync

// Remove one popup page in stack
Task RemovePageAsync(PopupPage page, bool animate = true) // Navigation.RemovePopupPageAsync
于 2017-03-02T09:44:08.347 回答