我嘗試了所有我可以做的事情,但它似乎需要不同的方法來更改黑色默認的blackground的顏色。Android如何更改應用程序的黑色默認背景顏色
這裏是圖片:http://imgur.com/a/CkQGX
下面是代碼:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EE7469"
android:orientation="horizontal">
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_margin="8dp"
card_view:cardUseCompatPadding="true"
card_view:cardCornerRadius="10dp"
android:background="#689F38"
card_view:cardElevation="5dp"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/list_item_string"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
android:paddingStart="8dp"
android:textSize="18sp"
tools:textSize="12sp"
android:background="#689F38"/>
<!-- ADDED SPACER VIEW -->
<View
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#689F38"
android:layout_weight="1"
/>
<!-- /ADDED SPACER VIEW -->
<Button
android:layout_marginTop="10dp"
android:id="@+id/delete_btn"
android:layout_width="30dip"
android:layout_height="30dip"
android:layout_gravity="right"
android:background="@android:drawable/ic_delete"/>
<Button
android:layout_marginTop="10dp"
android:id="@+id/edit_btn"
android:layout_width="30dip"
android:layout_height="30dip"
android:layout_toStartOf="@id/delete_btn"
android:layout_gravity="right"
android:layout_marginRight="40dp"
android:background="@android:drawable/ic_delete"
/>
</android.support.v7.widget.CardView >
</RelativeLayout>
我試圖改變背景顏色,但它仍然是黑色的。