要是用kotlin这项碉堡的功能,直接使用布局id,必须要在app build gradler中加入:

apply plugin: ‘kotlin-android-extensions’

在直接使用布局id是导入的包为:

import kotlinx.android.synthetic.main.activity_main.*

studio代码提示如下:
android studio 3.0 使用Kotlin抛弃findViewById()

相关文章:

  • 2021-12-27
  • 2022-12-23
  • 2021-05-07
  • 2022-01-10
  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
  • 2021-07-23
猜你喜欢
  • 2022-12-23
  • 2021-06-09
  • 2021-09-17
  • 2021-11-16
  • 2021-11-30
  • 2021-08-16
  • 2021-12-29
相关资源
相似解决方案