I'm currently trying to put together a layout consisting of a few input controls and a listview, and using layout_weight I've gotten it to look the way I want it in the Android Studio preview. However, on an actual device, the layout looks completely different.
I'm fairly new to Android and have been having a few problems with their layouts before, so I'm probably missing something. However, I've been reading up on different kinds of layouts and layout_weight in particular, and everything I've found so far makes me think the result would look like in Android Studio's preview. I could easily settle for another layout in this case, but I would prefer to actually learn what's wrong, as I may face the same issue again in the future.
Below is my layout code and comparison images. Any ideas or hints are much appreciated.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="@+id/input_title"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:hint="@string/title"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<Button
android:id="@+id/input_submit"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:text="@string/input_submit"/>
<Button
android:id="@+id/input_date"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/input_submit"
android:text="@string/input_date"/>
<EditText
android:id="@+id/input_amount"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_alignBottom="@id/input_date"
android:layout_toLeftOf="@id/input_date"
android:hint="@string/amount"
android:inputType="numberDecimal"/>
</RelativeLayout>
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6"/>
</LinearLayout>
Android Studio preview: https://i.stack.imgur.com/4bWM6.png
Actual layout on device: https://i.stack.imgur.com/MJbOX.png