<?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">
<TableLayout
android:id = "@+id/embedded_map_Tble"
android:layout_width = "fill_parent"
android:layout_height = "fill_parent"
>
<TableRow
android:layout_weight = "1"
>
<WebView
android:id = "@+id/embedded_map_WebView"
android:layout_width = "fill_parent"
android:layout_height = "fill_parent"
android:layout_weight = "1"
/>
</TableRow>
<TableRow>
<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight = "1"
android:layout_below = "@id/embedded_map_WebView"
android:enabled="true"
android:clickable="true"
android:apiKey="MY_API_KEY"
/>
</TableRow>
</TableLayout>
</RelativeLayout>
答案 0 :(得分:1)
您应该将两个视图都设置为线性布局的一部分,将其高度设置为0dp,将权重设置为1并将线性布局的方向设置为垂直。
如需更多帮助,请参阅:Linear Layout and weight in Android