Android文本框如何变成白色

要将Android文本框的背景颜色设置为白色,可以通过以下方法实现:

在XML布局文件中,可以通过设置android:background属性将文本框的背景颜色设置为白色,如下所示:

<EditText
    android:id="@+id/editText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@android:color/white" />

在Java代码中,也可以通过设置文本框的背景颜色来实现,如下所示:

EditText editText = findViewById(R.id.editText);
editText.setBackgroundColor(getResources().getColor(android.R.color.white));

通过以上方法,可以将Android文本框的背景颜色设置为白色。

阅读剩余
THE END