<?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="wrap_content">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/header"
android:layout_width="wrap_content"
android:layout_height="@dimen/height"
android:background="@color/orange7">
<TextView
android:padding="@dimen/padding_5dp"
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/title" />
<TextView
android:padding="@dimen/padding_5dp"
android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:text="@string/subtitle" />
</RelativeLayout>
<TextView
android:layout_below="@id/header"
android:padding="@dimen/padding_5dp"
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/description" />
</RelativeLayout>
У меня есть файл макета с вложенными относительными макетами.Только на устройствах Android P textviews
во внутренней относительной компоновке размещены неправильно.Этот файл макета используется для действия с Theme.AppCompat.Dialog
в качестве темы.
![enter image description here](https://i.stack.imgur.com/8nhJI.png)
На других устройствах Android (не на устройствах Android P), его получениерасположены правильно.
![enter image description here](https://i.stack.imgur.com/cNWXd.png)
Какая должна быть причина этого неправильного расположения на Android P?Изменение внешнего макета на линейный макет решает проблему.Почему это так?Заранее спасибо.