AppCompatEditText的默认背景是什么?

问题描述 投票:0回答:1

我想知道AppCompatEditText的默认背景是什么,因为我想将其用作xml中选择器状态的默认背景,但现在我仍然不知道该视图的默认背景是什么。

这是我目前所做的

private val defaultBackground = background

......

override fun setEnabled(enabled: Boolean) {
    if(enabled) this.background = defaultBackground
    else this.background = null
}
android kotlin android-appcompat android-button
1个回答
0
投票

AppCompatEditText的默认样式是Widget.AppCompat.EditText。浏览样式时,您会发现背景定义如下:

© www.soinside.com 2019 - 2024. All rights reserved.