在应用中,我想在MapFragment
中嵌入ScrollView
并将自定义片段放在SupportMapFragment
在较小的屏幕上工作就像一个魅力,但在一个足够大的显示器上,地图并没有占用它所能达到的所有尺寸。
而不是下面的固定layout_height
,我尝试了match_parent
,wrap_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>