android - Spaces between CardView -
i working on recycleview
, cardview
, there spaces between cards seem long, can show me how fix please have 2 files
friends_list_item.xml
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="16dp" > <android.support.v7.widget.cardview android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/friendslist" > <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="16dp" > <imageview android:layout_width="55dp" android:layout_height="55dp" android:id="@+id/picture" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:layout_marginright="16dp" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/username" android:layout_torightof="@+id/picture" android:layout_alignparenttop="true" android:textstyle="bold" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/status" android:layout_torightof="@+id/picture" android:layout_below="@+id/username" /> </relativelayout> </android.support.v7.widget.cardview> </linearlayout>
fragment_find_friends.xml
<?xml version="1.0" encoding="utf-8"?> <linearlayout 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" android:background="#e6e6e6" android:orientation="vertical" tools:ignore="textfields,contentdescription,uselessparent"> <linearlayout android:id="@+id/searchfieldcontainer" android:background="@color/white" android:layout_width="match_parent" android:layout_height="wrap_content"> <edittext android:id="@+id/searchfield" android:layout_width="0dp" android:layout_height="match_parent" android:layout_gravity="center" android:layout_marginleft="5dp" android:layout_weight="1" android:hint="@string/search_elipses"/> <imagebutton android:id="@+id/searchbtn" android:layout_width="46dp" android:layout_height="46dp" android:layout_gravity="center" android:layout_margin="5dp" android:background="@drawable/bg_follow_button" android:src="@drawable/ic_done_white_24dp"/> </linearlayout> <android.support.v7.widget.recyclerview android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/friendslist"/> </linearlayout>
here screenshot:
the liner layout "android:layout_height="match_parent"" change wrap_content
try :)
Comments
Post a Comment