0

In app, I want to embed a MapFragment in a ScrollView and put a custom fragment above a SupportMapFragment

Works like a charm on smaller screens, but on a large enough display, the map is not taking up all the size it could.

Instead of the fixed layout_height below, I tried match_parent, wrap_content, fiddling with the gravity of the LinearLayout. Any other tricks I could try?

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">
    <LinearLayout
        android:id="@+id/mapParent"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        android:gravity="center_horizontal|bottom">
        <fragment
            android:name="SomeCustomFragment"
            android:id="@+id/details_fragment"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" />
        <RelativeLayout
            android:id="@+id/relativeLayout1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:minHeight="480dp">
            <fragment
                android:id="@+id/map"
                android:layout_width="match_parent"
                android:layout_height="480dp"
                class="com.google.android.gms.maps.SupportMapFragment" 
                android:layout_alignParentBottom="true"/>
            <View
                android:id="@+id/imageView123"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@android:color/transparent" />
        </RelativeLayout>
    </LinearLayout>
</ScrollView>
Loy
  • 103
  • 11
  • 1
    Try android:fillViewport="true" on the ScrollView – ramaral Oct 23 '13 at 13:59
  • Somehow, that gives the mapsview no vertical space at all, thereby crashing my app because it wants to zoom with some padding it cannot get due to the 0px height. – Loy Nov 05 '13 at 17:54

0 Answers0