จะเพิ่มปุ่มเพื่อสั่งการในเมนูโอเวอร์โฟลว์ใน codenameone ได้อย่างไร?

ฉันกำลังพยายามเพิ่มปุ่มให้กับคำสั่งบนเมนูโอเวอร์โฟลว์ (สามจุด) โค้ดด้านล่างใช้ได้กับเมนูด้านข้าง (แฮมเบอร์เกอร์) แต่ใช้ไม่ได้กับเมนูล้น

Command rightMenuItem1 = new Command("Add Item");
Button item = new Button("Add Item");
item.setCommand(it); //it is a command object
rightMenuItem1.putClientProperty("SideComponent",item);
myToolbar.addCommandToOverflowMenu(rightMenuItem1);

ฉันจะทำอย่างไร? ขอบคุณมาก


person user8816162    schedule 23.10.2017    source แหล่งที่มา


คำตอบ (1)


ลบบรรทัดนี้:

rightMenuItem1.putClientProperty("SideComponent",item);

คุณไม่สามารถวางส่วนประกอบไว้ในโอเวอร์โฟลว์ได้

person Shai Almog    schedule 24.10.2017