i newbie android development , learning own. have strange problem of having strange space comes in between every item of recycler view. have following:
my recycler view vertical grid view layout of 2 spans(columns). have been trying is:
code layout
<?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="wrap_content" android:layout_marginleft="@dimen/size_five" android:layout_marginright="@dimen/size_five" android:layout_margintop="@dimen/size_fifteen" android:background="@color/blackcolor" android:clickable="true" android:focusable="true" android:orientation="vertical"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <linearlayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="50"> <imageview android:id="@+id/album_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@color/blackcolor" /> </linearlayout> <linearlayout android:id="@+id/lowerline" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="15" android:background="@color/hotpinkcolor" android:orientation="horizontal"> <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="4" android:orientation="horizontal"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginleft="@dimen/size_ten"> <textview android:id="@+id/album_title_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centervertical="true" android:gravity="left" android:text="album title" android:textcolor="@color/whitecolor" android:textsize="@dimen/size_eight" android:textstyle="bold"/> </relativelayout> </linearlayout> <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_marginright="@dimen/size_ten" android:layout_weight="5" android:orientation="horizontal"> <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent"> <imageview android:id="@+id/downloader" android:layout_width="@dimen/size_thirty_six" android:layout_height="@dimen/size_thirty_six" android:layout_centerinparent="true" android:src="@drawable/donwloaderimager"/> </relativelayout> </linearlayout> <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent"> <imageview android:id="@+id/setteraswall" android:layout_width="@dimen/size_fourty" android:layout_height="@dimen/size_fourty" android:layout_centerinparent="true" android:src="@drawable/setteras"/> </relativelayout> </linearlayout> </linearlayout> </linearlayout> </linearlayout> </linearlayout>
the black space showing strange space want remove.
change:
<linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <linearlayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="50"> <imageview android:id="@+id/album_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@color/blackcolor" /> </linearlayout>
to
<linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <linearlayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="50"> <imageview android:id="@+id/album_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@color/blackcolor" /> </linearlayout>
that change height of second parent linear layout wrap_content
Comments
Post a Comment