Codename One showNativePicker is not displaying

陌路散爱 提交于 2019-12-23 05:37:22

问题


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);

edit : added code block


回答1:


You should use the Picker class and not that API directly.

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.

To check if the native picker is supported use Display.isNativePickerTypeSupported.



来源:https://stackoverflow.com/questions/23619615/codename-one-shownativepicker-is-not-displaying

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!