Form containerForm=new Form(filename);
StringItem label1 = new StringItem("","Test\nTest2\nTest3");
StringItem label2 = new StringItem("","Test\nTest2\nTest3");
label2.setLayout(Item.LAYOUT_LEFT|Item.LAYOUT_TOP|Item.LAYOUT_SHRINK );
label2.setLayout(Item.LAYOUT_RIGHT|Item.LAYOUT_TOP|Item.LAYOUT_SHRINK );
containerForm.append(label1);
containerForm.append(label2);
display.setCurrent(containerForm);
此代码产生:
我想要它,所以两个 StringItems 彼此相邻,并且 test 与 test 对齐,依此类推。
我还尝试将两个字符串项合并为一个,并在它们之间添加一个制表符 (\t)。然而,标签化为乌有。