代号一个showNativePicker未显示 [英] Codename One showNativePicker is not displaying
问题描述
我搜索了一些简单的示例,这些示例使用了没有任何运气的选择器.
I have searched for simple examples of using a picker without any luck.
我想让我的选择器从一组字符串中拉出,以供用户选择,但是我似乎什至无法显示以下内容.
I would like to have my picker pull from a set of strings for the user to choose from, but I can not seem to even get the following to display.
Long now = new Date().getTime();
Date date = (Date) Display.getInstance().showNativePicker(Display.PICKER_TYPE_DATE, cal, now, null);
添加了代码块
推荐答案
您应该使用Picker类而不是直接使用该API.
You should use the Picker class and not that API directly.
本机选择器仅在某些特定类型的选择器中受支持,并且仅在物理Android/iOS设备上受支持. Picker类在不可用时无缝地显示Spinner.
Native picker is only supported for some specific types of picker and only on physical Android/iOS devices. The Picker class seamlessly shows a Spinner instead when unavailable.
要检查是否支持本机选择器,请使用Display.isNativePickerTypeSupported
.
To check if the native picker is supported use Display.isNativePickerTypeSupported
.
这篇关于代号一个showNativePicker未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!