我正在开发一个应用程序,使用设计支持库编译“com.android.support:design:22.2.0”。我的活动设计的xml代码如下所示。
http://prntscr.com/89in6t
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include
android:id="@+id/toolbar1"
layout="@layout/toolbar" />
</android.support.design.widget.AppBarLayout>
这里,actionbar根据滚动显示/隐藏。
我的问题是,当actionbar被隐藏并转到其他活动并完成它,然后返回到同一活动。此时actionbar显示为空白,如下所示
http://prntscr.com/89iw4y
如何解决?