是否有可能有邊緣/填充的ListView沒有應用到頁眉的邊距?我希望我的ListView像Google Now佈局一樣。除了這個小問題外,我已經做好了一切工作。Android:邊界/填充的ListView沒有應用到頁眉的邊距?
問題:是否有可能沒有ListView的佈局參數適用於其頭部?
編輯1:更多信息
紫色視圖是listView的標題。 我已經嘗試添加邊距到列表項目layout.This也不工作。 我需要的是一種將邊距應用到列表視圖的方法,以便它不會將邊距應用於listView中的標題。
EDIT2: 我的佈局 header.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:orientation="vertical" >
<View
android:layout_width="match_parent"
android:layout_height="@dimen/top_height"
android:background="@color/top_item" />
<View
android:id="@+id/placeholder"
android:layout_width="match_parent"
android:layout_height="@dimen/sticky_height"
android:layout_gravity="bottom" />
</FrameLayout>
root_list.xml
<LinearLayout>
<com.abhijith.CustomListView
android:id="@android:id/list"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_height="wrap_content" /></LinearLayout>
list_item.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/card_background"
android:orientation="vertical" >
<TextView
android:id="@+id/textview_note"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/textview_note_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"/></LinearLayout>
我由於此處被拆除uselsess佈局屬性這篇文章的長度。
應用填充同樣爲所有項目和不適填充到頁眉查看。 – TNR
我認爲你的意思是增加邊界到listItem layout.It沒有工作。 – redshift13
我的意思是添加填充到每個列表項目佈局項目。並且不要將其添加到標題。 – TNR