我正在尝试将屏幕分成两个部分。上面的部分是一个地图小部件,下面是另一个填充了小部件的布局。问题在于地图小部件占据了整个屏幕。如何使得地图下方的布局向上推动地图呢?
我猜可以通过给地图小部件设置高度来解决,但这并不是很灵活。
我的尝试:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:apiKey="my api key" />
<RelativeLayout
android:id="@+id/map_menu"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/mapview"
android:background="@drawable/locatie_background" >
<Button android:id="@+id/firstButtonId" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="@string/action_ready"
/>
</RelativeLayout >
</RelativeLayout>
layout_weight
在RelativeLayout
中被忽略。 - Octavian HelmLinearLayout
?你想把地图向上推多少? - ernazm