📜  android kotlin 不能在 MainActivity 中 @+id - Kotlin 代码示例

📅  最后修改于: 2022-03-11 14:53:32.778000             🧑  作者: Mango

代码示例1
// in build.gradle(Module:your_app.app) at the begginig of file add last id
// this will allow to call elements from xml in MainActivity.kt file
// for example: button1.setOnClickListener()...

plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-android-extensions'
}