Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid view disappears when setting layout_height to fill_parent
    text
    copied!<p>I have list items and I want to add a rectangle that is the full height of the item to the left side of the view, this is the list item xml (sorry for weird formatting):</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/list_item" android:background="@drawable/rowselector" android:layout_height="wrap_content" android:layout_width="fill_parent" android:paddingTop="5sp" android:paddingBottom="5sp" android:paddingLeft="10sp" android:paddingRight="10sp"&gt; &lt;View android:id="@+id/stop_color_shape" android:background="@drawable/stop_color_shape" android:layout_height="fill_parent" android:layout_width="20dp" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:text="Name" android:textStyle="bold" android:id="@+id/text" android:textColor="@color/text" android:textSize="18sp" android:layout_toLeftOf="@+id/star" android:layout_centerVertical="true"/&gt; &lt;CheckBox android:focusable="false" android:layout_width="wrap_content" android:layout_alignParentRight="true" android:button="@drawable/btn_star" android:id="@+id/star" android:layout_height="fill_parent" android:layout_alignParentTop="true"/&gt; </code></pre> <p></p> <p>When the View's (stop_color_shape)layout_height is set to 20dp, it shows, when it's set to fill_parent it doesn't</p> <p>the drawable (stop_color_shape) is:</p> <pre><code>&lt;shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"&gt; &lt;solid android:color="#FFFFFF"/&gt; &lt;stroke android:width="3dp" android:color="#FFFFFF"/&gt; &lt;/shape&gt; </code></pre>
 

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