开发者

BlackBerry: TreeField with BitmapField

开发者 https://www.devze.com 2023-02-01 23:26 出处:网络
I want to display the contacts in a TreeField like: An image followed by a username My understanding is that I use a Bit开发者_StackOverflow社区mapField to display the image, but I don\'t see how to

I want to display the contacts in a TreeField like:

An image followed by a username

My understanding is that I use a Bit开发者_StackOverflow社区mapField to display the image, but I don't see how to combine a BitmapField with a TreeField.


You can't use another field with a TreeField. You need to implement the TreeFieldCallback.drawTreeItem() method and do the drawing yourself


See my answer to a similar StackOverflow question: "Customising Blackberry Treefield."

In that answer, I've re-drawn each row of a TreeField along with a Bitmap image replacing the default (+)-icon of TreeField.


You can do it by using graphics.drawBitmap() method and graphics.drawText() method and using the index and y parameters inside the drawTreeItem() method of class which implements TreeFieldCallback interface

0

精彩评论

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