当有足够的空间时,将MapFragment与scrollview底部对齐

时间:2013-10-23 13:36:15

标签: android scrollview mapfragment

在应用中,我想在MapFragment中嵌入ScrollView并将自定义片段放在SupportMapFragment

上方

在较小的屏幕上工作就像一个魅力,但在一个足够大的显示器上,地图并没有占用它所能达到的所有尺寸。

而不是下面的固定layout_height,我尝试了match_parentwrap_content,摆弄了LinearLayout的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>

0 个答案:

没有答案