Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't align ImageViews to the left in ListView Row (RelativeLayout)
    primarykey
    data
    text
    <p><img src="https://i.stack.imgur.com/CkGly.png" alt="Actual View"></p> <p>This is how I have my view at the moment.</p> <p>As you can see, the icons are not all aligned all the way to the left. The red line is my objective. If they go all the way to the left, no problem, because I can solve it later with <code>marginLeft</code>.</p> <p>This is my XML code (<strong>layout/listview_style_listview.xml</strong>):</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;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" &gt; &lt;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" &gt; &lt;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)" /&gt; &lt;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" /&gt; &lt;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" /&gt; &lt;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" /&gt; &lt;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" /&gt; &lt;/LinearLayout&gt; &lt;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" /&gt; &lt;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" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>This is my XML code (<strong>layout/listview_style_row.xml</strong>)</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:minHeight="35dp" &gt; &lt;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" /&gt; &lt;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" /&gt; &lt;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" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>PS: I added an arrow icon to the right after the screenshot and that's why it's not showing on the image but I guess it's not important.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload