RecyclerView 列表布局 应用 视图绑定 ( ViewBinding )
VI . GitHub 代码地址
I ...., 及 关联界面操作 , 其中的 this 就是 ViewGroup 类型的 , 即组件本身 , 调用上述方法 , 可以将两个操作都完成 ;
package kim.hsl.vb;
import android.content.Context...RecyclerView 列表布局 应用 视图绑定 ( ViewBinding )
----
RecyclerView 列表布局 应用 视图绑定 ( ViewBinding ) :
① 视图绑定需要在...Adapter 适配器的 onCreateViewHolder( ) 方法中进行初始化 , 只有在这里才能拿到 ViewGroup parent 关联组件的父类容器 ;
② 初始化视图绑定类并关联界面..., 及 关联界面操作 , 其中的 this 就是 ViewGroup 类型的 , 即组件本身 , 调用上述方法 , 可以将两个操作都完成 ;
③ 自定义 ViewHolder 构造函数 : public