1

I am quite new to Android Development and have been following guides. I have a drawer layout with different fragments for each of the different screens. Inside 1 of the fragment is another SupportMapFragment which I am using for Google Maps. The thing with this is that once I place the fragment inside the linear layout, I cannot place button or item after it as it fills to the bottom of the screen.

<RelativeLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:layout_marginTop="16dp"
        android:orientation="vertical">

    <fragment
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="16dp" />
    <Button
        android:id="@+id/btn_submitReport"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:text="Button" />
    </LinearLayout>
</RelativeLayout>

I can change the fragment height to 350dp and it will obviously work but I was wondering if it can be done automatically so that for larger devices it will be longer with the button lower down etc.

What I basically am trying to achieve

Thanks

uniQ
  • 115
  • 2
  • 16

0 Answers0