Yo – Im trying to place a web view and a map view into the same activity but I’m having a bit of trouble. I’m trying to allow the web view to inhabit half of the screen and the other half will be occupied by the map view. Here is my code:
<?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>
You should make both the views a part of a linerlayout , Set their height to 0dp , weight to 1 and set the orientation of the linear layout to vertical.
For more help refer this : Linear Layout and weight in Android