c# - 如何避免导航视图中出现这种奇怪的状态栏?
问题描述
我试图为两者设置或设置fitSystemWindow
为,以及,但它仍然存在..true
flase
coordinator layout
navigation view
编辑:这里的代码,奇怪status bar
的出现在顶部navigation view
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_marginTop="?android:attr/actionBarSize"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:openDrawer="start">
<include
android:id="@+id/mainPage"
layout="@layout/main_page"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:background="@color/colorPrimaryDark"
app:itemIconTint="@android:color/white"
app:itemTextColor="@android:color/white"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer"
android:layout_gravity="start"
android:paddingTop="10dp"
android:layout_width="250dp"
android:layout_height="match_parent"/>
</android.support.v4.widget.DrawerLayout>
解决方案
我看不到其他代码,但有一个类似的演示,它工作正常。链接在这里。你可以参考一下。
主要代码是:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="#33B86C"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:layout_width="match_parent">
<FrameLayout
android:background="@android:color/holo_purple"
android:id="@+id/content_frame"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_height="match_parent"
android:layout_width="200dp"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:menu="@menu/menu" />
</android.support.v4.widget.DrawerLayout>
推荐阅读
- visual-c++ - MFC:CCombobox SetCursel 不正确
- java - Jackson:参数 #0 没有属性名称,不可注入:不能用作 Creator
- r - R:将具有相同数据的列组合在一起的功能
- html - 尝试将 SVG 剪辑路径居中在模式上
- typescript - 不允许基于对象键的打字稿数组子集
- java - 如何最好地确定一个字符串是否只包含空字符?
- r - 从 BASE R 中的两个列表中提取 data.frame
- python - 基准 Tensorflow GPU 推理速度
- visual-studio-code - 我可以使用 vscode:// 打开远程文件吗
- validation - 是的,使用动态数据进行验证