[英]How can I dynamically create and place a button before a button?
I have learned how to add a button after an existing button dynamically, but is it possible to dynamically insert a button before something? 我已经学习了如何动态地在现有按钮之后添加按钮,但是可以动态地在某个按钮之前插入按钮吗?
When "+ Add Person" is clicked, it will insert a button in between the very first button and the "+ Add Person" button. 单击“ +添加人员”时,它将在第一个按钮和“ +添加人员”按钮之间插入一个按钮。
Then it will extend the gridView vertically when it the maximum columns have been met. 然后,当达到最大列数时,它将垂直扩展gridView。
I have a solution for your question. 我有一个解决您的问题的方法。 Here they are :
他们来了 :
For the expand to next row, like screenshot number 2. You need to create logic to see if the ArrayList is exceed your maximum button count. 对于扩展到下一行,如2号屏幕截图。您需要创建逻辑以查看ArrayList是否超过最大按钮数。 Then the structure of layout will be different also.
这样布局的结构也将不同。 It will have :
它将有 :
Please ask if you need further explanation. 请询问您是否需要进一步的解释。 Thank you !.
谢谢 !。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.