Listview 在blackberry 7中创建列表视图

Listview 在blackberry 7中创建列表视图,listview,blackberry,blackberry-eclipse-plugin,Listview,Blackberry,Blackberry Eclipse Plugin,我正在开发一个应用程序,在其中我需要自定义列表,如上图所示,这样每个列表都应该有一个单击事件,因此当单击时,它应该导航到其他屏幕。这应该显示在屏幕中选项卡栏和状态栏的中间 每个列表应该包含发件人姓名、消息、日期和评级图像的详细信息,格式如图所示 但这并没有提供所需的格式化输出 MyScreen.java listcallback.java 我开始知道我必须使用表视图。但我无法理解如何实现这种格式。请帮助我,我是黑莓开发的新手,任何样本或建议都将不胜感激 public class MyScree

我正在开发一个应用程序,在其中我需要自定义列表,如上图所示,这样每个列表都应该有一个单击事件,因此当单击时,它应该导航到其他屏幕。这应该显示在屏幕中选项卡栏和状态栏的中间

每个列表应该包含发件人姓名、消息、日期和评级图像的详细信息,格式如图所示 但这并没有提供所需的格式化输出

MyScreen.java listcallback.java 我开始知道我必须使用表视图。但我无法理解如何实现这种格式。请帮助我,我是黑莓开发的新手,任何样本或建议都将不胜感激

 public class MyScreen extends UiApplication
 {
 public static void main(String[] args)
 {
     ListFields theApp = new ListFields();
     theApp.enterEventDispatcher();
 }
 public MyScreen()
 {
     pushScreen(new ListFieldScreen());
 }
 } 
 class ListFieldScreen extends MainScreen
{
private ListField _listField;
private Vector _listElements;

public ListFieldScreen() 
{
    setTitle("List Field Sample");
}
}
_listElements = new Vector(); 
_listField = new ListField();
ListCallback _callback = new ListCallback();
_listField.setCallback(_callback);
add(_listField);
initializeList();
 private void initializeList()
{
String itemOne = "Name";
String itemTwo = "Message";
_listElements.addElement(itemOne);
_listElements.addElement(itemTwo);
reloadList();
}
private void reloadList()
{
_listField.setSize(_listElements.size());
}
private class ListCallback implements ListFieldCallback 
{
public void drawListRow(ListField list, Graphics g, int index, int y, int w) 
{ 
    String text = (String)_listElements.elementAt(index); 
    g.drawText(text, 0, y, 0, w); 
} 
public Object get(ListField list, int index) 
{
    return _listElements.elementAt(index); 
} 
public int indexOfList(ListField list, String prefix, int string) 
{ 
    return _listElements.indexOf(prefix, string); 
} 
public int getPreferredWidth(ListField list) 
{ 
    return Display.getWidth(); 
} 
}