开发者

How to draw background image of listfield rows?

开发者 https://www.devze.com 2023-02-28 03:46 出处:网络
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:

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

精彩评论

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