代码之家  ›  专栏  ›  技术社区  ›  jasil

从其他活动恢复时,我的操作栏显示为空白

  •  0
  • jasil  · 技术社区  · 10 年前

    我正在开发一个应用程序,使用设计支持库编译“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

    如何解决?

    1 回复  |  直到 10 年前
        1
  •  1
  •   Farbod Salamat-Zadeh    10 年前

    我认为这是设计支持库中的一个错误。

    我通过添加一个空 View 低于我的 Toolbar .