开发者

How to draw background image of listfield rows?

I have a customized ListField with an icon and text on each rows. How can i 开发者_开发问答add background images to rows (in drawListRow() method).


I think it should be smth like this:

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);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜