0

在应用程序中,我想在 a 中嵌入 a并MapFragment在 aScrollView上方放置一个自定义片段SupportMapFragment

在较小的屏幕上就像一个魅力,但在足够大的显示器上,地图并没有占据它可以占据的所有尺寸。

而不是下面的固定layout_height,我尝试match_parentwrap_content摆弄gravity线性布局。我可以尝试任何其他技巧吗?

<?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>
4

0 回答 0