1、Kotlin中如何直接通过组件id来操作组件?
解决方案:在build.gradle中添加对相应插件的使用即可。
plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-android-extensions'
}
        2、Kotlin中Button设置背景颜色没有效果。
解决方案:在res->values->themes.xml文件中修改如下代码:
<style name="Theme.MyKotlinDemo" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge">
        3、Kotlin中如何使用静态类或者静态方法?
解决方案:
//静态方法
companion object {
    fun actionStart(context: Context) {
        var intent = Intent(context, ServiceIpActivity::class.java)
        context.startActivity(intent)
    }
}
//静态类
object SPUtils {...}
        4、Kotlin中EditText的赋值问题。
ServiceIP_etServiceIP.text = Editable.Factory.getInstance().newEditable(hostIp)