[英]How do i change the background on the buttons XML-AndroidStudio?
我正在 Android Studio 中開發一個小應用程序,但我無法更改按鈕顏色。 我已經嘗試了一切,只改變背景,backgroundtint,來制作一個新的可繪制對象,但我似乎找不到任何答案,這是我的按鈕 XML 布局:
<Button
android:id="@+id/calc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="55dp"
android:layout_marginTop="45dp"
android:background="@drawable/round_green_shape"
android:text="CALCULA">
</Button>
這是我背景的 XML:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:padding = "10dp">
<solid android:color="@color/buttonsGreen">
</solid>
<corners
android:radius="15dp">
</corners>
</shape>
我將不勝感激任何幫助,
謝謝
完成,我只需要刪除
android:background = ""
並設置:
android:backgroundTint = ""
變綠...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.