代号 One MultiButton setCheckBox(true) 不工作

Codename One MultiButton setCheckBox(true) not working

我使用代号 1 3.5.8 并且需要向多按钮添加一个复选框(例如 https://www.codenameone.com/javadoc/com/codename1/components/MultiButton.html)但是当将它添加到我的代码时,它似乎被忽略了,复选框没有添加到我的多按钮,这种行为发生在模拟器和我的测试设备(android 6.0)上。除了 setCheckBox(true)

之外,还有什么需要应用的吗?

img2: img3:

MultiButton 本身应该成为一个复选框,并根据 API 约定呈现。如果按钮已经显示在 UI.

中,您可能需要 revalidate()
Form hi = new Form("Multibutton", BoxLayout.y());

MultiButton component = new MultiButton(); 
component.setTextLine1("Name"); 
component.setTextLine2("Numero de reservacion:"); 
component.setTextLine3("Fecha de reservacion:"); 
component.setTextLine4("Estado:"); 
component.setCheckBox(true); 
hi.addComponent(component);

hi.show();

如果有人有同样的行为,问题是因为在某些主题中,复选框图像使复选框不可见,解决方案是删除(或替换)常量选项卡中的复选框相关图像(在主题上编辑器)就像这里解释的那样: