黑莓:TreeField 与 BitmapField
I want to display the contacts in a TreeField like:
An image followed by a username
My understanding is that I use a BitmapField to display the image, but I don't see how to combine a BitmapField with a TreeField.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您不能将其他字段与 TreeField 一起使用。您需要实现 TreeFieldCallback.drawTreeItem() 方法并自己进行绘制
You can't use another field with a TreeField. You need to implement the TreeFieldCallback.drawTreeItem() method and do the drawing yourself
请参阅我对类似 StackOverflow 问题的回答:“自定义 Blackberry Treefield”。
在该答案中,我重新绘制了 TreeField 以及 位图 图像替换 TreeField。
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.
您可以通过使用
graphics.drawBitmap()
方法和graphics.drawText()
方法并使用实现类的drawTreeItem()方法中的index和y参数来完成TreeFieldCallback
接口You can do it by using
graphics.drawBitmap()
method andgraphics.drawText()
method and using the index and y parameters inside the drawTreeItem() method of class which implementsTreeFieldCallback
interface