我正在使用J2ME波兰版2.1.2,并试图将net.rim.device.api.ui.component.DateField从黑莓添加到tableItem中。它显示正确,但即使在将其设置为可编辑之后,我也无法更改其上的任何内容。还有其他人有过这种经历吗?
I= tableItem
tfInput = new DateField(_meta.Title, System.currentTimeMillis(), mode);
//#style textInputCell
this.set(0, 0, tfInput);
this.setSelectionMode(TableItem.SELECTION_MODE_CELL);编辑:这样做的原因是因为黑莓上的Datefield.TIME输入模式有问题,如果你使用J2ME的DateField。
发布于 2014-06-02 15:48:36
解决此问题的方法是扩展J2ME Polish的DateField并在将模式设置为时间时拦截,如下所示:
public class MyDateField extends DateField{
public MyDateField (String title, int mode){
super(title, mode);
// Blackberry has bug in time mode, so going for date time instead and formatting date
if (mode == DateField.TIME){
super.setInputMode(DateField.DATE_TIME);
super.setDateFormatPattern("HH:mm");
}
}
}现在,您可以有效地使用DATE_TIME作为时间。
https://stackoverflow.com/questions/23993407
复制相似问题