我有一个包含以下内容的布局:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
app:toolbarId="@+id/action_bar"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<com.rbrlnx.cover.GroupSummaryCoverView
android:layout_below="@id/action_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/group_summary_cover_view"
app:layout_collapseMode="parallax"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:fitsSystemWindows="true"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<include layout="@layout/group_info_title_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/group_detail_components_lateral_margin"
android:layout_marginRight="@dimen/group_detail_components_lateral_margin"
android:layout_marginLeft="@dimen/group_detail_components_lateral_margin"/>
<View android:id="@+id/name_setting_divider"
android:layout_height="@dimen/space_medium"
android:layout_width="match_parent"
style="@style/group_detail_list_top_divider"/>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/lv_participants"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</LinearLayout>
这就是结果:

怎么了?正如您所看到的,ToolBar并没有完整地显示出来。
发布于 2015-12-27 18:20:49
fitsSystemWindows属性用于在整个屏幕上绘制视图,包括statusbar的区域。它通常用于在状态条后面绘制一个自定义的背景,当它是透明的。
由于您没有使用透明的statusbar,所以可以轻松地从布局中删除所有fitsSystemWindows属性。所以景色不会隐藏在它的背后。
发布于 2015-12-27 18:44:25
您可以尝试从styles.xml目录将其粘贴到您的values-v21文件中:
<item name="android:windowTranslucentStatus">false</item>https://stackoverflow.com/questions/34483271
复制相似问题