Я пытаюсь сделать работу с картами, чтобы карта отображалась под кнопкой и текстовым видом.Android - MapFragment с TextView и Button сверху
С рисунком ниже карта работает, но кнопка и вид текста занимают место в нижней части экрана.
Я пробовал различные варианты, такие как изменение макета до относительного и т. Д., Но когда я использую относительный макет, карта вообще не отображается.
Есть ли способ достичь того, что я хочу?
<?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>
Вы хотите, чтобы текст и кнопка на карте выше или ниже? – Prince
@ Принц * карта показывает внизу *. В самой первой строке :) –
затем наложите фрагмент ниже тега кнопки – Prince