j2me如何将图像放入列表中?

发布于 2024-12-14 21:11:00 字数 213 浏览 4 评论 0原文

我有一个菜单作为扩展列表的类。有一个本机方法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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

江南烟雨〆相思醉 2024-12-21 21:11:01

您可以使用 J2ME-Polish 样式来完成此操作。你需要设置MenuItem的宽度就可以实现。

you can do it with the use of J2ME-Polish Style. You need to set the width of the MenuItem and you can achieve it.

暮倦 2024-12-21 21:11:00

不幸的是,没有记录如何控制列表项的绘制方式。列表项的绘制非常依赖于实现。

Unfortunately, there are no documented controls over how list items are drawn. Drawing of the list items is very dependent on the implementation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文