2016-05-16 11 views
1

私はいくつかのアイテムを持つRecyclerViewを持っています。それぞれの行の間にできるだけ少ないスペースでアイテム同士が直接接触するのではなく、次のような各項目間に大きなギャップがあります。(申し訳ありませんがイメージはあまり良くありません。 RecyclerViewためRecyclerViewアイテム間に大きなスペースがあります

Image displaying the issue

マイレイアウトファイルはここにある:

<?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"> 

<TextView 
    android:id="@+id/layout_list_name" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentStart="true" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentTop="true" 
    android:textStyle="bold" 
    android:textAppearance="?android:attr/textAppearanceLarge" /> 

<TextView 
    android:id="@+id/layout_list_date" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignStart="@+id/layout_list_name" 
    android:layout_alignLeft="@+id/layout_list_name" 
    android:layout_below="@+id/layout_list_name" /> 

<ImageButton 
    android:id="@+id/layout_list_delete" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentTop="true" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentEnd="true" 
    android:contentDescription="@string/layout_list_delete" 
    android:src="@drawable/delete" /> 

は、どのように私はこの巨大なギャップを取り除くのですか?

+0

ポストフルxml。 –

+1

更新された回答を参照してください –

+0

あなたにはリサイクルビュー –

答えて

0

layout_height="match_parent"layout_height="wrap_content"に変更してみてください。うまくいけばあなたの問題を解決するはずです。

+1

はい!それは完璧に働いた! –

+0

私のために働いていません。 –

関連する問題