2016-09-09 10 views
0

非常に基本的なカスタムlistviewを作成しましたが、画像でわかるように、アイテムの間に大きなスペースがあります。 私の責任はどこにあるのか分かりません。カスタムリストビュー内のアイテム間のスペース

私のxml:

<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 
    <CheckBox 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/list_item_crime_solved_checkBox" 
    android:padding="4dp" 
    android:layout_alignParentRight="true" /> 
    <TextView 
    android:id="@+id/list_item_crime_title_TextBox" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_toLeftOf="@+id/list_item_crime_solved_checkBox" 
    android:textStyle="bold" 
    android:padding="4dp" 
    tools:text="Crime Title"/> 
    <TextView 
    android:id="@+id/list_item_crime_date_TextBox" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_toLeftOf="@+id/list_item_crime_solved_checkBox" 
    android:layout_below="@+id/list_item_crime_title_TextBox" 
    android:padding="4dp" 
    tools:text="Crime Date"/> 
    </RelativeLayout> 
+0

ここで、写真ですか? – Rodriquez

+0

画像はどこですか?スペースを削除する場合は、パディングを削除して、親レイアウトに余白または余白があるかどうかを確認してください。 –

+0

relativeLayoutの高さをmatch_parentからwrap_contentに変更する – Amir

答えて

0

私はあなたがここに投稿したレイアウトがlist_view上の各項目に膨張させるために使用されているとします。したがって、相対レイアウトのlayout_heightwrap_contentに設定します。

関連する問題