画面の上半分だけをマップに表示し、下半分に他のレイアウトを表示しようとしています。テーブルレイアウトと組み合わせて重みを使用すると、これが可能になるはずであることがわかりました。しかし、同じ XML コードは、say ボタンでは完全に機能しますが、マップでは機能しません。
スクリーンショットはこちら.
XML コード:
<TableLayout
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
>
<com.google.android.maps.MapView
android:id="@+id/map2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="0_z4IHjB6EnXohnoyoudontgoVmhg"
android:clickable="true" >
</com.google.android.maps.MapView>
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" >
<Button android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="SECOND"></Button>
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" >
<Button android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="SECOND"></Button>
</TableRow>
</TableLayout>
Mapview ブロックをボタンで置き換えると、スクリーンショットの最初の画像のようになりますが、現在は 2 番目の画像のように見えます。
どちらの場合も、重みパラメーター、layout_width、または高さを変更しませんでしたが、何らかの理由でサイズが変更されました。MapView で画面の半分だけをカバーするにはどうすればよいでしょうか?