问题
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