Я пытаюсь отобразить заголовок с TextView и Spinner над фрагментом карты.Предварительный просмотр студии Android показывает мой макет, как я хочу, но при запуске карта занимает весь экран.
Код XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:id="@+id/rl_header"
android:background="#FFF">
<TextView
android:id="@+id/miles_select_text"
android:text="@string/miles_select_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"/>
<Spinner
android:id="@+id/miles_spinner"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_alignEnd="@+id/miles_select_text"/>
</RelativeLayout>
</RelativeLayout>
Изображение предварительного просмотра студии Android (как я хочу этотоже посмотри):
Как это на самом деле выглядит:
Может кто-нибудь сказать мне, что я здесь не так делаю?
Большое спасибо