android内容协调,android – 协调器布局内容显示在状态栏后面

我正在构建一个带有地图片段的工具栏作为其中的一部分.工具栏固定在位并且不透明.

每当视图的内容向上滚动时,地图片段随之移动,但它在工具栏上方可见(因此在状态栏本身和状态栏的橙色背景之间).

这是由此产生的问题:

tf4l1.png

如果我滚动一点,稀松布正常消失,但为时已晚.

当它在工具栏上方时,是否有一种不绘制内容的方法?或者在AppBarLayout内容前面绘制状态栏背景的方法?

我已经尝试在AppBarLayout前面绘制一个视图(在状态栏的正下方),但是一旦MapFragment一直向上滚动,它就会被带到该视图的前面,使MapFragment在一瞬间可见.

xmlns:app="http://schemas.android.com/apk/res-auto"

xmlns:tools="http://schemas.android.com/tools"

android:id="@+id/main_content"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:clickable="true"

android:fitsSystemWindows="true">

android:id="@+id/appbar"

android:layout_width="match_parent"

android:layout_height="@dimen/promotion_details_image_height"

android:clickable="true"

android:fitsSystemWindows="true"

android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

android:id="@+id/collapsing_toolbar"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:background="@color/orange"

android:fitsSystemWindows="true"

app:layout_scrollFlags="scroll|exitUntilCollapsed">

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_marginTop="?attr/actionBarSize">

android:id="@+id/map"

android:name="com.google.android.gms.maps.SupportMapFragment"

android:layout_width="match_parent"

android:layout_height="match_parent"

app:layout_collapseMode="none"

tools:context=".restaurants.stores.StoresFragment" />

android:id="@+id/minimizeBtn"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_margin="@dimen/stores_details_minimize_margin"

android:clickable="true"

android:contentDescription="@null"

android:paddingTop="@dimen/status_bar_height"

android:src="@drawable/selector_map_minimize_btn"

android:visibility="gone" />

android:id="@+id/cardDetailsLayout"

layout="@layout/store_card_small_detail"

android:layout_width="match_parent"

android:layout_height="@dimen/stores_details_card_height"

android:layout_alignParentBottom="true"

android:layout_margin="10dp"

android:visibility="gone" />

android:id="@+id/toolbar"

android:layout_width="match_parent"

android:layout_height="?attr/actionBarSize"

android:background="?attr/colorPrimary"

android:minHeight="?attr/actionBarSize"

app:layout_collapseMode="pin"

app:popupTheme="@style/ThemeOverlay.AppCompat.Light">

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:ellipsize="end"

android:singleLine="true"

android:text="@string/store_toolbar_text"

android:textColor="@color/white"

android:textSize="@dimen/toolbar_text_size"

app:font="@string/fontFlamaMedium" />

android:id="@+id/list"

android:layout_width="match_parent"

android:layout_height="match_parent"

app:layout_behavior="@string/appbar_scrolling_view_behavior" />

编辑:

在布局xml中,android:layout_behavior属性与我的RecyclerView相关联,但工具栏的内容具有正确的行为,问题是它在状态栏下是可见的,我不希望它.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值