0
У меня этот макет в моей деятельности, и я хочу добавить фрагмент диалога в «map_extras
», однако фрагмент диалога не размещается в центре экрана. Что я делаю неправильно?Размещение фрагмента диалога в центре экрана
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map_activity"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/map_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
</RelativeLayout>
<RelativeLayout
android:id="@+id/map_extras"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
</RelativeLayout>
Это диалог макет фрагмента:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#FFFFFF"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="asdf1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="asdf2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="asdf3" />
</LinearLayout>