首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ToolBar its不满

ToolBar its不满
EN

Stack Overflow用户
提问于 2015-12-27 18:04:05
回答 2查看 50关注 0票数 1

我有一个包含以下内容的布局:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>

代码语言:javascript
复制
<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并没有完整地显示出来。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-12-27 18:20:49

fitsSystemWindows属性用于在整个屏幕上绘制视图,包括statusbar的区域。它通常用于在状态条后面绘制一个自定义的背景,当它是透明的。

由于您没有使用透明的statusbar,所以可以轻松地从布局中删除所有fitsSystemWindows属性。所以景色不会隐藏在它的背后。

票数 1
EN

Stack Overflow用户

发布于 2015-12-27 18:44:25

您可以尝试从styles.xml目录将其粘贴到您的values-v21文件中:

代码语言:javascript
复制
<item name="android:windowTranslucentStatus">false</item>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34483271

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档