クラスで getInfoWindow を上書きして追加された RelativeLayout を使用する Google Maps API v2 のカスタム情報ウィンドウがあります。このレイアウトには、最初の行にタイトルのある TextView があり、次の行に 3 つの TextView があります。それは機能しますが、ウィンドウが画面全体を占めるため、タブレットのような大画面では非常に見苦しくなります。
RelativeLayout の幅を固定値 (「50dp」としましょう) または「wrap_content」に設定しようとしましたが、常に画面全体を使用します。
これは、レイアウトの XML です。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bus_stop_info_window"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#ffffffff" >
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="A title" >
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:gravity="left"
android:text="Test1" >
</TextView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:gravity="center"
android:text="Test2" >
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:gravity="left"
android:text="Test3" >
</TextView>
</RelativeLayout>
どうすれば目的の効果を達成できますか?