Kotlin findViewById 发表于 2017-12-22 | 分类于 Java , Android , View Java findViewByIdKotlin findViewById1234567private val button by bindView<Button>(R.id.button)// 或者private val button:Button by bindView(R.id.button)fun <T : View> Activity.bindView(@IdRes res: Int): Lazy<T> { return lazy { findViewById<T>(res) }}