Note that there are some explanatory texts on larger screens.

plurals
  1. POChild's layout of RelativeLayout with match_parent ant minHeight issue
    primarykey
    data
    text
    <p>I have strange issue. I have LinearLayout which contains some fixed sized elements and one ReletiveLayout, which use remain space of parent space (weight=1). Simple layout:</p> <pre><code>&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" &gt; &lt;LinearLayout android:id="@+id/LinearLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingLeft="16dp" android:paddingRight="16dp" tools:context=".LoginActivity" &gt; &lt;ImageView android:id="@+id/imageView1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="16dp" android:layout_marginTop="@dimen/space_between_views" android:src="@drawable/logo" /&gt; &lt;EditText android:id="@+id/login" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:ems="10" android:hint="@string/login" android:inputType="text" android:singleLine="true" android:text="aneworld@gmail.com" &gt; &lt;requestFocus /&gt; &lt;/EditText&gt; &lt;EditText android:id="@+id/password" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:hint="@string/password" android:inputType="textPassword" android:singleLine="true" android:text="pandora9" /&gt; &lt;Button android:id="@+id/submit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="8dp" android:text="@string/login_button" /&gt; &lt;RelativeLayout android:id="@+id/RelativeLayout1" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:minHeight="100dp" &gt; &lt;TextView android:id="@+id/support" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_gravity="bottom" android:layout_marginTop="0dp" android:layout_weight="1" android:gravity="center_horizontal|bottom" android:padding="8dp" android:text="@string/support_number" /&gt; &lt;TextView android:id="@+id/forgot_password" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/support" android:layout_centerHorizontal="true" android:layout_marginBottom="20dp" android:padding="@dimen/space_between_views" android:text="@string/forgot_password" /&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; &lt;/ScrollView&gt; </code></pre> <p>I added minHeight parameter, for fix issues for small screens. But, if remain space of parent is smaller than this minHeight, <strong>Forgot Password</strong> child goes to top of parent, ABOVE flag is ignored. Why? </p> <p>I know other way to make this working, but I just want to know why happens this.</p> <p>I added screenshots for what:</p> <p>Remaining space is bigger, so Forgot password is above support: <img src="https://i.stack.imgur.com/M3QQF.png" alt="Remaining space is bigger, so Forgot password is above support"></p> <p>Remaining space is smaller, so Forgot password is top on parent: <img src="https://i.stack.imgur.com/zP4s1.png" alt="Remaining space is smaller, so Forgot password is top on parent"></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.
    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