1

I am currently working on list fields. In my list, each row contains title, subtitle and image. I need a list of rows as output. Each row should contain two labelfiels and one bitmap.

Can any tell me a way to do it?

4

1 回答 1

1

您应该为您的 ListField 实现 ListFieldCallback。然后,您将能够在 ListFieldCallback 方法 drawListRow 中所选位置的每一行中添加图像和文本。

要添加图像,请使用 graphics.drawBitmap。(图形是drawListRow的一个参数)

drawBitmap(int x, int y, int width, int height, Bitmap bitmap, int left, int top)

x 是您的位图将被放置的该行左侧的像素数。Y 是该行顶部的像素数。因此,您可以使用 y+10 使图像与行顶部的间距为 10 像素。

和 graphics.drawText 同样允许您将文本放置在相对于行的左侧和顶部的位置。

如何实现 ListFieldCallback

于 2010-12-29T14:32:18.710 回答