Skip to content Skip to sidebar Skip to footer

Limiting The Mapview To Half The Screen

I am trying to get the map to fill in only the upper half of the screen and some other layout in the bottom half. Now I know that this should be possible using weights in combinati

Solution 1:

Sorry Urban, gave you a bum steer on it - I had looked at this before and the only way I could limit the map size was programmatically, however, I have since done it with this type of layout:

<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"android:orientation="vertical" ><FrameLayoutandroid:id="@+id/map_frame"android:layout_width="fill_parent"android:layout_height="wrap_content"android:layout_weight="0.7" ><com.google.android.maps.MapViewandroid:id="@+id/map_view"android:layout_width="fill_parent"android:layout_height="match_parent"android:enabled="true"android:clickable="true"android:apiKey="dgvbdj_my_secret_key_nvc8mxcksos"/></FrameLayout><co.uk.mycompany.ui.MapNavBarandroid:id="@+id/map_nav"android:layout_width="fill_parent"android:layout_height="70dip"android:layout_gravity="bottom"android:layout_weight="0.3" />

The last item shown is a custom widget but the layout should show the principles involved. This limited the map height but allowed it to go full width.

Post a Comment for "Limiting The Mapview To Half The Screen"