我使用addComponent(索引,cmp),然后重新验证我将cmp添加到的容器,但cmp总是添加到容器的底部(容器组件的最后一项)-它没有考虑索引。有什么想法吗?
otherLabel is a codenameone label
otherField is a codenameone textfield
Container7 is a container with 14 components
findContainer7().addComponent(8,otherLabel);
findContainer7().addComponent(9,otherField);
findContainer7().revalidate();在此之后,otherLabel和otherField将显示在UI中容器的最后(索引13,14)
发布于 2015-05-15 02:55:02
索引只对某些布局管理器有影响。由于您没有提到布局管理器,我猜您选择了索引不相关的表布局,因为它是基于约束的布局。
https://stackoverflow.com/questions/30238797
复制相似问题