Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个菜单作为扩展列表的类。有一个本机方法 append(String txt, Image image) 添加一个新的菜单项。问题是我想在一开始就附加一个 100% 宽度的图像作为一个菜单项,但如果我这样做:
append("", image);
它将图像大小设置为与其他图像一样小。如何将其宽度设置为 100% 或至少设置为图像的大小?
不幸的是,没有关于如何绘制列表项的记录控制。列表项的绘制非常依赖于实现。
您可以使用J2ME-Polish样式来做到这一点。你需要设置的宽度,MenuItem你可以实现它。
J2ME-Polish
MenuItem