Android 在CollepsingtoolbarLayout中具有标题的字幕,具有折叠效果

Android 在CollepsingtoolbarLayout中具有标题的字幕,具有折叠效果,android,android-coordinatorlayout,android-appbarlayout,Android,Android Coordinatorlayout,Android Appbarlayout,我正在使用材料设计collepsingToolbarLayout在appbar中与coordinatorLayout配合使用 我的第一个问题是,我需要添加标题类似于工具栏的字幕,但在Collepsingtoolbarlayout中设置字幕没有覆盖。 我的第二个问题是,它应该是像whats应用程序用户档案活动这样的标题。我只需要根据需要定制 我的密码在这里 <android.support.design.widget.AppBarLayout android:id="@+id/appbar"

我正在使用材料设计collepsingToolbarLayout在appbar中与coordinatorLayout配合使用

我的第一个问题是,我需要添加标题类似于工具栏的字幕,但在Collepsingtoolbarlayout中设置字幕没有覆盖。 我的第二个问题是,它应该是像whats应用程序用户档案活动这样的标题。我只需要根据需要定制

我的密码在这里

<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="@dimen/profile_header_height"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="16dp"
app:expandedTitleMarginStart="20dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_collapseMode="parallax">

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/mainView"
        android:layout_width="match_parent"
        android:layout_height="@dimen/profile_header_height"
        android:background="@color/colorPrimary"
        >
        <ImageView
            android:id="@+id/ivAvatar"
            android:layout_width="@dimen/appbar_profile_pic_height_width"
            android:layout_height="@dimen/appbar_profile_pic_height_width"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="@dimen/profile_header_margin_top"
            android:layout_marginLeft="?android:attr/listPreferredItemPaddingLeft"
            android:contentDescription="@string/userPictureDes"
            android:src="@drawable/ic_user_circle_white" />
        <TextView
            android:id="@+id/text_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:singleLine="true"
            android:text="@string/example_user_name"
            android:layout_centerHorizontal="true"
            android:layout_below="@+id/ivAvatar"
            android:layout_marginBottom="@dimen/list_text_padding_top"
            android:layout_marginTop="5dp"
            android:textColor="@android:color/white"
            android:textSize="@dimen/profile_name_text_size" />
    </RelativeLayout>
</FrameLayout>
<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:layout_gravity="top"
    app:layout_collapseMode="pin"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />


CollepsingToolbar版面中的图像和文本应使用动画进行折叠,并将文本名称设置为标题,如上面提到的whats应用程序

请展示您迄今为止尝试过的内容。太好了,我已经对其声音进行了优化,谢谢,我知道已经晚了,但以防万一,有人想找同样的参考,请展示你迄今为止所做的尝试。太好了,我已经把它投了好票,谢谢,我知道已经晚了,但以防万一,有人想找同样的参考,请参考