I have a Scrollview
as my parent container which contains a map, and then some information below the map. It currently looks like the image below.
I'm trying to make it so that the map takes up half of the screen using layout_weight
but I've had no luck. Can anyone tell me what I'm doing wrong?
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<fragment
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context="com.thevisitapp.visitapp.PlacesActivity"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:id="@+id/map" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/summaryLabel"
android:paddingLeft="16dp"
android:background="@color/gray"
android:text="summary"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/summary"
android:layout_below="@+id/summaryLabel"
android:paddingLeft="16dp"
android:paddingTop="16dp"
tools:text="actual summary"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/contactsLabel"
android:background="@color/gray"
android:layout_below="@+id/summary"
android:paddingTop="5dp"
android:paddingLeft="16dp"
android:text="contact"/>
</RelativeLayout>
</LinearLayout>