下面是我的黑莓设备代码片段。它是一个包含3个项目的列表小部件。问题是,当我运行它时,在我的黑莓模拟器中只有标题是可见的,这3个项目是不可见的。这个UI是基于j2me抛光的。我是不是在代码中遗漏了什么,请引导。
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";
我并不是说这是正确的,但希望这可能是:
我认为你必须在黑莓中使用ListField而不是List;
最后add(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()是一个预定义的方法,因此它只显示"Title"
因为在黑莓ListField工作;