0

我有一个自定义的 ListField,每行都有一个图标和文本。如何将背景图像添加到行(在drawListRow()方法中)。

4

1 回答 1

1

我认为应该是这样的:

public void drawListRow(ListField listField, 
        Graphics graphics, int index, int y, int width) {

    Bitmap bg = <here is the code to get your Bitmap for bg>;
    // probably load that bitmap once in ListField constructor 
    // to speed up the drawListRow()

    graphics.drawBitmap(0, y, bg.getWidth(), bg.getHeight(), bg, 0, 0);
}
于 2011-04-20T15:05:56.200 回答