Android AppCompativeText的默认背景是什么?
我想知道什么是Android AppCompativeText的默认背景是什么?,android,kotlin,android-edittext,android-appcompat,android-button,Android,Kotlin,Android Edittext,Android Appcompat,Android Button,我想知道什么是AppCompatiEditText的默认背景,因为我想用它作为xml中选择器状态的默认背景,但现在我仍然不知道这个视图的默认背景是什么 这就是我目前所做的 private val defaultBackground = background ...... override fun setEnabled(enabled: Boolean) { if(enabled) this.background = defaultBackground else this.ba
AppCompatiEditText
的默认背景,因为我想用它作为xml中选择器状态的默认背景,但现在我仍然不知道这个视图的默认背景是什么
这就是我目前所做的
private val defaultBackground = background
......
override fun setEnabled(enabled: Boolean) {
if(enabled) this.background = defaultBackground
else this.background = null
}
appcompatitedtext
的默认样式是Widget.AppCompat.EditText
在样式中导航,可以发现背景是通过以下方式定义的:
<item name="android:background">?attr/editTextBackground</item>
?属性/编辑文本背景
在appcompat主题中查找此属性,可以找到:
<item name="editTextBackground">@drawable/abc_edit_text_material</item>
@drawable/abc\u edit\u text\u材料