1, dynamically create several view, such as Textview1, Textview2, Textview3, button (no) in the dynamic no ID, XML
2, generates a Arraylist
Check a lot of information in the process of thinking, the more the more disorderly, contact a lot of concepts, such as observables, annotations reflection, layoutmanager, adapter, recycleview, these seemingly can realize this function, the problem is as follows:
Just use viewdatabinding how to realize dynamically created controls binding? Assuming that XML structure as follows
(some through the parent id, addview created the view)
.
CodePudding user response:
Have a plug-in SAO yearsDynamic binding of XML is gradle a Java file generated at compile time
CodePudding user response:
I know, but I just want to learn the databinding, watched so many now, also knew the databinding is how to return a responsibility, it can understand so, compiling before the program execution, and dynamic databinding surface, the actual compiled XML is static, then the runtime dynamically created in the compiled program these view is impossible to enter binding, because activitydatabinding. Java has been generated, the binding is done,