
我的状态栏出了问题,我的工具栏被推开了.
我想要的功能是当用户向下滚动ListVIEw时,工具栏会消失在状态栏后面,这样只有选项卡可见,就像在WhatsApp和YouTube应用程序中一样.
为了达到这个效果或获得这个功能,我使用了这一行:
app:layout_scrollFlags="scroll|enteralways"进入我的androID.support.v7.Widget.Toolbar,但我之前说过,状态栏会被推开.
<?xml version="1.0" enCoding="utf-8"?><androID.support.design.Widget.CoordinatorLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" 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:fitsSystemwindows="true" tools:context=".MainActivity"> <androID.support.design.Widget.AppbarLayout androID:ID="@+ID/appbar" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:paddingtop="@dimen/appbar_padding_top" androID:theme="@style/Apptheme.AppbarOverlay"> <androID.support.v7.Widget.Toolbar androID:ID="@+ID/toolbar" androID:layout_wIDth="match_parent" androID:layout_height="?attr/actionbarSize" app:layout_scrollFlags="scroll|enteralways" androID:background="?attr/colorPrimary" app:popuptheme="@style/Apptheme.PopupOverlay"> </androID.support.v7.Widget.Toolbar> <androID.support.design.Widget.TabLayout androID:ID="@+ID/tabs" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" /> </androID.support.design.Widget.AppbarLayout> <androID.support.v4.vIEw.VIEwPager androID:ID="@+ID/container" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_vIEw_behavior" /></androID.support.design.Widget.CoordinatorLayout>解决方法:
我有同样的问题,并设法解决它.只需删除该行:
androID:fitsSystemwindows="true"来自协调员布局.您可以在VIEwPager中进一步向下布局,但在顶层它似乎会导致该问题.
总结以上是内存溢出为你收集整理的android – 工具栏推送状态栏全部内容,希望文章能够帮你解决android – 工具栏推送状态栏所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)