как добавить текстовые данные в макет координатора между видом переработчика и сворачивающейся панелью инструментов - PullRequest
0 голосов
/ 22 апреля 2020

Я пытаюсь добавить текст между сворачивающейся панелью инструментов и представлением переработчика, но не добился желаемых результатов, когда я открываю действие, представление переработчика в порядке, но текст скрывается под свернутой компоновкой панели инструментов. при прокрутке вниз появляется текст, вот мой код

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 
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:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".PlanDetailActivity">


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

<com.google.android.material.appbar.AppBarLayout
    android:id="@+id/app_bar"
    android:layout_width="match_parent"
    android:layout_height="@dimen/app_bar_height"
    android:fitsSystemWindows="true"
    android:theme="@style/AppTheme.PopupOverlay">

    <com.google.android.material.appbar.CollapsingToolbarLayout
        android:id="@+id/toolbar_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        app:contentScrim="?attr/colorPrimary"
        app:expandedTitleGravity="start|bottom"
        app:expandedTitleTextAppearance="@style/ExpandedAppBar"
        app:collapsedTitleTextAppearance="@style/CollapsedAppBar"
        app:layout_scrollFlags="scroll|exitUntilCollapsed"
        app:toolbarId="@+id/toolbar">

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:src="@drawable/index_my_plan"
            android:scaleType="fitXY"/>

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:layout_collapseMode="pin"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

    </com.google.android.material.appbar.CollapsingToolbarLayout>

</com.google.android.material.appbar.AppBarLayout>

вот мое содержание этого макета, который содержит вложенный вид прокрутки и линейный макет, содержащий два дочерних элемента

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_width="match_parent"
android:layout_height="wrap_content"

app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".PlanDetailActivity"
tools:showIn="@layout/activity_plan_detail">

<androidx.core.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:fillViewport="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">


        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:layout_marginStart="16dp"
            android:text="Exercises" />


        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rvPlanDetail"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:layout_marginStart="16dp"
            android:layout_marginEnd="16dp"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />
    </LinearLayout>

</androidx.core.widget.NestedScrollView>

enter image description here

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...