0
我试过新的CollapsingToolbarLayout与工具栏,一切都很好,除了一件事。CollapsingToolbarLayout标题不放入工具栏
下面的代码`
<android.support.design.widget.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="256dp"
android:fitsSystemWindows="true"
android:focusable="true"
app:contentScrim="?attr/colorPrimary">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsingToolbarLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginBottom="32dp"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="@+id/venue_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="100dp"
android:src="@drawable/user_header_one"
app:layout_collapseMode="parallax"
app:layout_scrollFlags="scroll" />
<android.support.v7.widget.Toolbar
android:id="@+id/finish_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:layout_collapseMode="pin">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/nestedScrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
.............has linearlyout and it's child
`
问题是,当我开始滚动nestedscrollview,在工具栏里面collapspingtoolbar没有得到冠军。
看来,当我点击手机设置,回到我的应用程序获取焦点的工具栏,然后让崩溃的标题进入工具栏内,这真的很奇怪。
这是下糖豆4.1.6
从'imageView'和'toolbar' resp移除'app:layout_scrollFlags =“scroll”'&'android:fitsSystemWindows =“true”''添加'android:fitsSystemWindows =“true”'到'imageView' –
不,没有工作,仍然collapsingtoolbar布局没有进入工具栏 –
尝试这个[教程](http://blog.grafixartist.com/toolbar-动画与-Android的设计支持库/)。 –