I am trying to make the mapfragment work such that the map shows beneath the button and the text view.
With the layout below, the map works but the button and the text view take up space at the bottom of the screen.
I have tried various options like changing the layout to relative out etc, but when I use relative layout, the map does not display at all.
Is there a way to achieve what I want?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<fragment
android:id="@+id/map"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
class="com.google.android.gms.maps.MapFragment" />
<AutoCompleteTextView
android:id="@+id/stationName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif-condensed"
android:hint="Select/Type station name to track"
android:text="" />
<Button
android:id="@+id/but1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/stationName"
android:background="@drawable/black_button"
android:fontFamily="sans-serif-condensed"
android:text="Start Tracking"
android:textColor="@color/white"
android:textSize="20dp" />
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:paddingTop="15dp"
android:textAlignment="center"
android:textSize="14dp" />
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:paddingTop="15dp"
android:textAlignment="center"
android:textSize="14dp" />
</LinearLayout>