Android studio 3.6.0 绑定视图使用方法
1.确保你的 build gradle 最低为3.6.0
dependencies { classpath 'com.android.tools.build:gradle:3.6.0'
}
2、在你的项目里的build gradle配置以下代码,注意 是在 android { } 里面配置
android{
viewBinding{
enabled = true; }
}
android {
//.........
viewBinding {
enabled = true;
}
}
depend