Pretty simple problem but I just can’t seem to configure this correctly.
I would a ListVieww aligned right taking up 100dp of layout_width, whilst a MapControl takes up the remaining space. (I’d rather it take up remaining space to take advantage of the phone being put in a horizontal position.
Here’s what I have at the moment.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_gravity="left" >
<com.google.android.maps.MapView
android:id="@+id/gmap"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:layout_gravity="left"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/maplst"
android:layout_width="100dp"
android:layout_gravity="right"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/listView1"
android:layout_width="118dp"
style="@style/listViewStyle"
android:layout_height="wrap_content" android:layout_gravity="right">
</ListView>
</LinearLayout>
</LinearLayout>
I think you don’t need all these layouts (optimization point). To take the remaining space, use
layout_width="0dp"with alayout_weight="1".This should be want you want: