I want to make a layout at the bottom of the screen to take as much height as it needs, and another layout at the rest of the screen - from top to the start of the other layout. But I dont know how to do it: here is what i did so far:
<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"
android:gravity="bottom"
android:background="@color/background_material_dark"
tools:context="com.example.exercise2.myapplication.HangedMan">
<LinearLayout
android:layout_width="match_parent"
android:id="@+id/viewLayout"
android:gravity="center|center_horizontal"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/imageView"
android:src="@drawable/img0" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:id="@+id/mainLayout"
android:layout_below="@+id/viewLayout"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="vertical">
</LinearLayout>
</RelativeLayout>
the layout that should be at the top is above the other layout as should be, but he doesnt get rest of the screen height