mohamed agamy
mohamed agamy

Reputation: 53

make layout that overlay above google map fragment in android

I need to make LinearLayout that overflow an android google map as shown in this image any one has any idea how to make this I need help ? android google map and linearlayout above it

Upvotes: 0

Views: 3054

Answers (2)

Sagar Zala
Sagar Zala

Reputation: 5134

You can use RelativeLayout as parent layout.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <fragment
        android:id="@+id/mapFragment"
        android:name="com.google.android.gms.maps.MapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true" />

    <LinearLayout
        android:id="@+id/topLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:orientation="horizontal">

    </LinearLayout>

    <LinearLayout
        android:id="@+id/bottomLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:orientation="vertical">

    </LinearLayout>

</RelativeLayout>

Upvotes: 0

You can try use FrameLayput

<FrameLayout...>

   <MapFragment.../>

   <LinearLayout...>

   // your layout

   </LinearLayout>

</FrameLayout>

Upvotes: 4

Related Questions