以下是我的黑莓设备代码片段。这是一个包含3个项目的列表小部件。问题是当我运行它时,只有标题在我的黑莓模拟器中可见3个项目是不可见的。这个UI基于j2me polish.Am我在代码中遗漏了一些东西,请指导。< / p>
de.enough.polish.ui.List transTypeList = new de.enough.polish.ui.List("", List.IMPLICIT);
// transTypeList.setInfo("View Transaction Status. Select the Transaction Status to view details.");
System.out.println("Setting Title");
transTypeList.setTitle("View Transaction Status. Select the Transaction Status to view details.");
//#style list1
transTypeList.append("Processed Transactions", null);
//#style list1
transTypeList.append("Un-Processed Transactions", null);
//#style list1
transTypeList.append("Rejected Transactions", null);
transTypeList.addCommand(backCmd);
transTypeList.setCommandListener(this);
System.out.println("Setting Title");
//#style nameTicker
transTypeList.setTicker(nameTrans);
display.setCurrent(this.transTypeList);
currentItem = "transTypeList";
答案 0 :(得分:0)
我并不是说这是正确的,但希望如此:
我认为你必须在黑莓中使用ListField而不是List;
最后添加(listField);
意思是:
ListField transTypeList=new ListField(ListField.HIGHLIGHT_FOCUS);
//Write what you want according to blackberry methods;
add(transTypeList);//without adding field to the screen you didn't get anything;
setTitle()是一种预定义的方法,所以它只显示“标题”
因为在黑莓ListField工作;