在下面的圖像是我的列表視圖下和我的按鈕上方的灰色區域。我希望該區域具有與列表相同的背景顏色(黑色)。背景顏色(列表視圖?)
什麼似乎很奇怪,我是在模擬器中它是黑色的,但我的手機上,這是這個灰色。
我試過設置佈局,列表和cachecolorhint的背景顏色...不管是什麼,它保持灰色。
當前佈局:
<?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="match_parent"
android:background="#000000" >
<TextView
android:id="@+id/header"
android:layout_width="fill_parent"
android:layout_height="27dp"
android:layout_alignParentTop="true"
android:layout_gravity="center|center_vertical"
android:gravity="center"
android:textColor="#00ccff"
android:textSize="20dp" />
<TextView
android:id="@+id/horizontalline"
android:layout_width="match_parent"
android:layout_height="2dip"
android:layout_below="@id/header"
android:background="#8b8b8b"
android:paddingBottom="2dip"
android:paddingTop="2dip" />
<Button
android:id="@+id/AddButton"
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_alignParentBottom="true"
android:layout_gravity="center"
android:gravity="center|top"
android:textSize="12dp" >
</Button>
<ListView
android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="@id/horizontalline"
android:background="#000000"
android:cacheColorHint="#000000"
android:layout_above="@id/AddButton"
android:drawSelectorOnTop="false"
android:listSelector="@android:color/transparent" />
<TextView
android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/header"
android:gravity="center" />
</RelativeLayout>
任何幫助表示讚賞。
編輯
要清楚,我有一個列表中沒有問題,當它填補了屏幕,它的時候,那裏已經沒有填滿屏幕,我得到這個灰色的背景只有幾個項目...我更喜歡它與列表相同的黑色背景。
give android:cacheColorHint =「#000000」as#00000000。那麼這個TextView的用途是什麼android:id =「@ android:id/empty」? –
沒有。一樣。 – Barak