j2me如何将图像放入列表中?
我有一个菜单作为扩展列表的类。有一个本机方法append(String txt, Image image)可以添加一个新的菜单项。问题是我想在一开始就附加一个 100% 宽度的图像作为一个菜单项,但如果我这样做:
append("", image);
它会将图像尺寸设置为与其他图像尺寸一样小。如何将其宽度设置为 100% 或至少为图像的大小?
I have a menu as a class which extends List. There's a native method append(String txt, Image image) which adds a new menu item. The thing is that I want to append a 100% width image as one menu item in the very beginning but if I do this:
append("", image);
it sets the image size as small as the other's. How can I set its width 100% or at least the size of the image?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
J2ME-Polish
样式来完成此操作。你需要设置MenuItem
的宽度就可以实现。you can do it with the use of
J2ME-Polish
Style. You need to set the width of theMenuItem
and you can achieve it.不幸的是,没有记录如何控制列表项的绘制方式。列表项的绘制非常依赖于实现。
Unfortunately, there are no documented controls over how list items are drawn. Drawing of the list items is very dependent on the implementation.