java - Why these ImageButtons(delete and update) are overlaying -
this .xml layout of item in recycleview list, last 2 buttons overlaying
<?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" android:background="#ffffff" android:baselinealigned="false" android:weightsum="1"> <linearlayout android:id="@+id/thumbnail" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="3dip" android:layout_alignparentleft="true" android:background="@drawable/favorite" android:layout_marginright="5dip"> <imagebutton android:id="@+id/imagebutton" android:layout_width="25dip" android:layout_height="25dip" android:background="@null" android:src="@drawable/nofavorite"/> </linearlayout> <textview android:id="@+id/text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_aligntop="@+id/thumbnail" android:layout_torightof="@+id/thumbnail" android:text="rihanna love way lie" android:textcolor="#040404" android:typeface="sans" android:textsize="15dip" android:textstyle="bold"/> <textview android:id="@+id/artist" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textcolor="#343434" android:textsize="10dip" android:layout_torightof="@+id/thumbnail" android:text="just gona stand there , ..." android:layout_below="@+id/text_view" /> <imagebutton android:layout_width="wrap_content" android:id="@+id/update" android:layout_height="wrap_content" android:src="@drawable/nofavorite" android:background="@null" android:layout_alignright="@+id/artist" /> <imagebutton android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@null" android:id="@+id/delete" android:src="@drawable/favorite" android:layout_alignright="@+id/artist" /> </relativelayout>
they should in end of right, in end delete button , in left of button in right end of screen update button, bind buttons later
and question, how can make divider btw items?
thank =)
it because use layout_alignright="@+id/artist"
on both images align right edges of 2 images right edge of view id artist. achieve want, use layout_alignparentright="true"
on delete button , layout_toleftof="@+id/delete"
on update button. way, why need layout_weightsum on parent. works linearlayout.
for making divider between items, can either use background left (right) border on 1 of items or put view between them.
Comments
Post a Comment