我剛剛開始在Android,並正在啓動一個啓動畫面。我試圖將默認背景顏色更改爲灰色,但顯然我無法兩次使用相同的屬性。我如何添加背景圖片並更改背景顏色?謝謝。定義兩次可能的相同屬性?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/reddit_alien"
android:background="@color/grey"
>
</LinearLayout>
「如何添加背景圖像並更改背景顏色?」 - 根據定義,這是不可能的,因爲只有*一個*背景。它是一個圖像*或*一種顏色。編輯您的圖像以包含您想要的顏色。 – CommonsWare