Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/211.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android AppCompativeText的默认背景是什么?_Android_Kotlin_Android Edittext_Android Appcompat_Android Button - Fatal编程技术网

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材料