当前位置:网站首页>Kotlin插件 kotlin-android-extensions
Kotlin插件 kotlin-android-extensions
2022-06-12 06:52:00 【听*海】
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
}
现在这个插件不会自动导入了,那我们自己在build.gradle中添加,如上代码
这个插件会根据布局文件中定义的控件id自动生成一个具有相同名称的变量,我们可以在Activity里直接使用这个变量,而不用再调用findViewById()方法

如上图,我有一个按钮id为btn,直接用就好

边栏推荐
- The second revolution of reporting tools
- Idea common shortcut keys
- 集合判断存在交集
- XML special character escape
- June 9th training day - bit operation
- When SQL server2019 is installed, the next step cannot be performed. How to solve this problem?
- 初中学历,从不到3K,到月薪30K+,不设限的人生有多精彩
- 2021 robocom world robot developer competition - undergraduate group (Preliminary)
- Troubleshooting of cl210openstack operation -- Chapter experiment
- Delete the duplicate items in the ordered array -- force deduction question 26 (simple)
猜你喜欢

Node. Detailed installation tutorial of CPM and cnpm (including error resolution)

1. Foundation of MySQL database (1- installation and basic operation)

“我被大厂裁员了”

Junior high school education, less than 3k, to 30k+ monthly salary, how wonderful life is without restrictions

leetcode:剑指 Offer 66. 构建乘积数组【前后缀积的应用】

Dépannage de l'opération cl210openstack - chapitre expérience

【图像检测】基于深度差分和PCANet实现SAR图像变化检测附matlab代码

Database syntax related problems, solve a correct syntax

Elegantly spliced XML

The second revolution of reporting tools
随机推荐
网络丢包问题排查
Zhang Chi: is process a panacea?
The principle of SQL injection is to build sqli labs, and SQL injection is simple and practical
Tomato learning notes dvector and other basics
How to build your own website (using the pagoda panel)
丢掉丑陋的 toast,会动的 toast 更有趣
leetcode:剑指 Offer 66. 构建乘积数组【前后缀积的应用】
SQL Server 2019 installation error. How to solve it
Android studio uses database to realize login and registration interface function
Vscode Common plug - in
Tomato learning notes -vscade configuring makefile (using task.jason and launch.jason)
9 Sequence container
postman拼接替换参数循环调用接口
Flink practice
公众号也能带货?
Tomato learning notes -seq2seq
2 variables and basic types
新知识:Monkey 改进版之 App Crawler
六月集训 第七日 ——哈希表
When SQL server2019 is installed, the next step cannot be performed. How to solve this problem?