android - Can't align ImageViews to the left in ListView Row (RelativeLayout) -
this how have view @ moment.
as can see, icons not aligned way left. red line objective. if go way left, no problem, because can solve later marginleft
.
this xml code (layout/listview_style_listview.xml):
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/backgroundcolor" android:orientation="vertical" android:scaletype="center" > <linearlayout android:id="@+id/titlelayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margintop="2dp" android:layout_marginbottom="2dp" android:layout_marginleft="7dp" android:layout_marginright="7dp" android:background="@color/backgroundcolor" android:orientation="horizontal" > <textview android:id="@+id/sectiontitle" style="@style/sectiontitle" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:gravity="left" android:text="(blank)" /> <button android:id="@+id/sectioninfobutton" android:layout_width="33dp" android:layout_height="33dp" android:layout_gravity="right" android:layout_marginleft="3dp" android:layout_weight="0" android:background="@drawable/infoicon" /> <button android:id="@+id/sectioninfobutton" android:layout_width="33dp" android:layout_height="33dp" android:layout_gravity="right" android:layout_marginleft="3dp" android:layout_weight="0" android:background="@drawable/filtericon" /> <button android:id="@+id/sectionoptionsbutton" android:layout_width="33dp" android:layout_height="33dp" android:layout_gravity="right" android:layout_marginleft="3dp" android:layout_weight="0" android:background="@drawable/menuicontop2" /> <button android:id="@+id/addcatbutton" android:layout_width="33dp" android:layout_height="33dp" android:layout_gravity="right" android:layout_marginleft="3dp" android:layout_weight="0" android:background="@drawable/effect_button_add_cat_click" /> </linearlayout> <view android:layout_width="match_parent" android:layout_height="3dp" android:layout_marginbottom="0dp" android:layout_marginleft="0dip" android:layout_marginright="0dip" android:background="@color/blueoceanstroke" /> <listview android:id="@+id/list" android:layout_width="match_parent" android:layout_height="wrap_content" android:divider="@color/blueocean" android:dividerheight="1dp" android:listselector="@drawable/listview_style_list_selector" android:paddingbottom="1dp" /> </linearlayout>
this xml code (layout/listview_style_row.xml)
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:minheight="35dp" > <imageview android:id="@+id/catthumbnail" android:layout_width="32dp" android:layout_height="32dp" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:src="@drawable/bank1" /> <textview android:id="@+id/sectiontitle" style="@style/title" android:layout_width="97dp" android:layout_height="32dp" android:layout_alignbottom="@+id/catthumbnail" android:layout_alignparentleft="true" android:layout_alignparentright="true" android:layout_marginleft="66dp" android:gravity="center_vertical" android:text="title text" android:textcolor="@color/liststextcolor" android:textsize="15sp" android:textstyle="normal" android:typeface="normal" /> <imageview android:layout_width="25dip" android:layout_height="32dp" android:layout_alignbottom="@+id/sectiontitle" android:layout_alignparentright="true" android:gravity="center_vertical" android:src="@drawable/arrow" /> </relativelayout>
ps: added arrow icon right after screenshot , that's why it's not showing on image guess it's not important.
from screenshot layout ok because divider color @color/blueoceanstroke goes way , separators. problem must in "@+id/catthumbnail", if measure distance between red line , left edge of yellow square , compare distance between right edge of square , left edge of letter "b" same shouldn't be.
my guess there king of padding in @drawable/bank1. try remove , see if letter "b" left aligns title.
hope helps...
Comments
Post a Comment