我试图更改 xml 上的按钮背景颜色,但它没有改变。
这是我的代码
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:orientation="vertical">
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#ff0000"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我认为它可能工作正常,但它仍然是紫色:(