I'm just wasting time with this, because I have no idea how to do it properly. Basically, I want to have a custom input view, where the user can draw whatever he wants with his / her finger and, below it, I want to place 2 (or maybe more) buttons, which I don't want to overlap on top of the custom view. Because I'm trying to avoid hardcoding widths and heights, is there any way to specify that the buttons should wrap to their contents and the custom view should occupy the remaining height? Since I expect all buttons to have the same height, I guess that taking the height of one of them as a reference should work somehow...
Here's my current layout:
<RelativeLayout 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"
tools:context=".MainActivity" >
<com.example.myapp.DrawView
android:id="@+id/drawView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
<Button
android:id="@+id/buttonSave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="@string/save" />
<Button
android:id="@+id/buttonQuery"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="@string/query" />
</RelativeLayout>
Is it actually possible to achieve what I want easily, without having to hack it in nasty ways?