Search code examples
blackberryblackberry-eclipse-pluginlistfield

How to create a ListField with 2 textfield and 1 icon on each row?


I am new on Blackberry app. development. Can you suggest some documentations about custom ListField?


Solution

  • You can achive this easily with out using a custom list field. You just use "drawListRow" method class ListCallback implements ListFieldCallback.

    eg:

    private class ListCallback implements ListFieldCallback{
            public void drawListRow(ListField list, Graphics g, int index, int y,int w) {
    
     g.drawBitmap(0, y, mp3Bitmap.getWidth(), 50, mp3Bitmap, 0, 0);
     g.drawText(mediaTypeString,40, y, 0, w);    
     g.drawText(bitrate+" kbps", 40, y+20, 130, w);
    
    }
    

    This will create each row of ListFiled with one image and two row of text.