我有一個RelativeLayout
,我需要在它的中間有一個黑色背景和一個小圖像。我用這個代碼:RelativeLayout background image + color
<RelativeLayout
android:id="@+id/bottomBox"
android:layout_weight="4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bottom_box_back"
android:layout_marginTop="4dp"
/>
其中@drawable/bottom_box_back
是:
<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/logo_icon"
android:tileMode="disabled"
android:gravity="center"
android:filter="true"
/>
這樣我有圖像居中。但背景仍然是灰色的主窗口。我需要一個黑色的背影遍佈RelativeLayout
空間。有什麼建議麼?
如何使用層列表可繪製資源? 1.將純色可繪製爲底層2.將位圖層放在底層 – kingori
上面!非常感謝! –