Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid layout not as expected
    primarykey
    data
    text
    <p>So I am a beginner at layouts in Android and I am learning <code>RelativeLayout</code>. I am attempting to make the following: </p> <p><img src="https://i.stack.imgur.com/XAFIK.png" alt="enter image description here"> </p> <p>However, all I get in my virtual device is the name field taking up 100% of the space (width and height).<br> <img src="https://i.stack.imgur.com/F6tTC.png" alt="enter image description here"> </p> <p>Here is my XML: </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:id="@+id/root"&gt; &lt;EditText android:id="@+id/name" android:layout_alignParentLeft="true" android:layout_width="match_parent" android:layout_height="match_parent" android:hint = "Name"/&gt; &lt;EditText android:id="@+id/phone" android:layout_below="@id/name" android:layout_alignParentRight="true" android:layout_weight="0.4" android:layout_height="wrap_content" android:layout_width="0dp" android:hint="Phone" /&gt; &lt;EditText android:id="@+id/email" android:layout_below="@id/phone" android:layout_alignParentRight="true" android:layout_weight="0.4" android:layout_height="wrap_content" android:layout_width="0dp" android:hint="Email" /&gt; &lt;EditText android:id="@+id/dob" android:layout_below="@id/email" android:layout_alignParentRight="true" android:layout_weight="0.4" android:layout_height="wrap_content" android:layout_width="0dp" android:hint="D.O.B." /&gt; &lt;EditText android:id="@+id/address" android:layout_below="@id/phone" android:layout_alignParentLeft="true" android:layout_toLeftOf="@id/dob" android:layout_weight="0.6" android:layout_height="0dp" android:layout_width="match_parent" android:hint="Address" /&gt; &lt;Button android:id="@+id/submit" android:layout_weight="1.0" android:layout_below="@id/address" android:layout_height="match_parent" android:layout_width="0dp" android:text="Submit"/&gt; &lt;/RelativeLayout&gt; </code></pre> <p><strong>What is going wrong?</strong></p>
    singulars
    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.
    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