title: Android: Relative Layout
body: <p>Been using android for about 3 months and always hardcode the width and height of elements in a layout, I know this is considered bad to do so I want to get a better understand of how to use relative layouts to position elements. I have looked at the documentation of relative layout but from my understanding, I cannot get it to work the way I would like. I come asking if anyone can provide help (not just suggesting documentation I have read it) with how I need to use relative layout. This is so I can have something basic to refer to in future work to help with my positioning.</p>
  
  <p>The following is 3 elements contained on a relative layout, 2 expandable lists and 1 listview:
  <a href="https://i.stack.imgur.com/bY0hr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bY0hr.png" alt="enter image description here"></a></p>
  
  <p>The listviews are all over the place in this example I would like to know how to position them something like this:
  <a href="https://i.stack.imgur.com/upVyx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/upVyx.png" alt="enter image description here"></a></p>
  
  <p>this is the current xml, what would I need to add and change to gain this type of layout?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/activity_food_bible"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="#606E7F"
  tools:context="com.example.mr_br.project.food_bible"&gt;
  
  &lt;ExpandableListView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/exlistVtype"
      android:layout_alignParentTop="true" android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"/&gt;
  &lt;ExpandableListView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/exlistVpref"
      android:layout_alignParentTop="true" android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true" android:layout_marginLeft="114dp"
      android:layout_marginStart="114dp"/&gt;
   &lt;ListView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_marginTop="244dp"
          android:id="@+id/listVresult" android:layout_alignParentTop="true"
          android:layout_alignParentLeft="true" android:layout_alignParentStart="true"/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Thank you for any help.</p>