Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 代码名一个多按钮设置复选框(true)不工作_Java_Mobile_Codenameone - Fatal编程技术网

Java 代码名一个多按钮设置复选框(true)不工作

Java 代码名一个多按钮设置复选框(true)不工作,java,mobile,codenameone,Java,Mobile,Codenameone,我使用代码名one 3.5.8,需要在多按钮中添加一个复选框(如示例所示),但在将其添加到我的代码中时,它似乎被忽略,复选框没有添加到我的多按钮中,这种行为发生在模拟器上,也发生在我的测试设备(android 6.0)上。除了setCheckBox(true)之外,还有什么需要应用的吗 img2: img3: 多按钮本身应成为复选框,并根据API约定呈现。如果该按钮已显示在UI中,则可能需要一个revalidate() Form hi = new Form("Multibutton", Box

我使用代码名one 3.5.8,需要在多按钮中添加一个复选框(如示例所示),但在将其添加到我的代码中时,它似乎被忽略,复选框没有添加到我的多按钮中,这种行为发生在模拟器上,也发生在我的测试设备(android 6.0)上。除了setCheckBox(true)之外,还有什么需要应用的吗

img2: img3:
多按钮本身应成为复选框,并根据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();


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

谢谢,重新验证对我不起作用,有什么建议吗?这是我的代码:component.setTextLine1(String.valueOf(reservation.getEstablishmentName());setextline2(“保留编号:+String.valueOf(reservation.getRequiredSpace()));component.setTextLine3(“Fecha de reservacion:+reservation.GetFormattedDaterRequested”(“yyyy-mm-dd”);setextline4(“Estado:+reservation.getStatus());组件设置图标(reservationImage);setCheckBox(true);您是如何创建多按钮的?单击后是否会显示一个复选框?感谢您的帮助,以下是我的完整代码:MultiButton component=new MultiButton();setTextLine1(reservation.getEstablishmentName());setextline2(“保留编号:+String.valueOf(reservation.getRequiredSpace()));component.setTextLine3(“Fecha de reservacion:+reservation.GetFormattedDaterRequested”(“yyyy-mm-dd”);setextline4(“Estado:+reservation.getStatus());setCheckBox(true);这个.addComponent(component);它被添加到表单中(com.codename1.ui.Form的子类)。不,点击后不会显示复选框。嗯,真奇怪,有什么建议吗?它对我根本不起作用(请参见编辑的问题),请确保您的库是最新的(代码名一设置->基础->更新客户端库按钮)。如果这不能解决问题,我建议仔细检查我的代码和你的代码之间的差异。