Вложенный горизонтальный RecyclerView не рендерится под прозрачной панелью действий - PullRequest
0 голосов
/ 17 февраля 2020

Я вложил RecyclerView (держа карты) в ConstraintLayout. ConstraintLayout (темно-серый) является полноэкранным за прозрачной панелью действий, именно так, как и ожидалось, но RecyclerView (красный) настаивает на том, чтобы оставить пробел для панели действий.

Я должен что-то пропустить, но я могу ' t выяснить, что.

Я не изменяю ни ConstraintLayout, ни RecyclerView программно.

Экран показан здесь с использованием цветов sh для выделения:

enter image description here

content_main. xml здесь:

androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/darkGray"
android:fitsSystemWindows="true" >

<androidx.recyclerview.widget.RecyclerView
    android:id="@+id/recycler_view"
    android:layout_width="0dp"
    android:layout_height="@dimen/recycler_view_height"
    android:background="@color/colorWarning"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    android:fitsSystemWindows="true"
    android:clipToPadding="false" />

Этот макет вложен в activity_main. xml, как показано ниже:

<androidx.drawerlayout.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="23dp"
android:fitsSystemWindows="true"
tools:openDrawer="start">

<include
    layout="@layout/content_main" />

<com.google.android.material.navigation.NavigationView
    android:id="@+id/nav_view"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    app:headerLayout="@layout/nav_header"
    app:menu="@menu/menu_main" />

...