ヘッダーにマージンを適用せずに、ListView にマージン/パディングを設定することは可能ですか? ListView を Google Now のレイアウトのようにしたい。この小さな問題を除いて、すべてが機能しています。
質問: ListView のレイアウト パラメータをヘッダーに適用しないようにすることは可能ですか?
EDIT1:詳細
紫色のビューは、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.test.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>
この投稿が長くなったため、ここでは不要なレイアウト プロパティを削除しました。