比如我创建了一个layout,里面有一个button,然后在另外一个界面中include了这个layout四次,接着我想为四个button设置不同的text,应该如何完成?
PS0: 单个button只是举个例子,实际上是一个比较复杂的layout
PS1: 实际应用中如果需要在一个layout中多次使用相同的非官方组件,该如何解决这个问题?
迷茫2017-04-18 09:08:48
Set the id for each include, you can find different Views based on different ids and get the controls in them based on the View.
迷茫2017-04-18 09:08:48
Directly use findViewById(buttonName) to get the corresponding Button, and then set the corresponding requirements