通知栏覆盖在操作栏上

时间:2015-11-12 12:25:09

标签: android android-actionbar

我已将ActionBar添加到我的Android应用中。它在Lollipop中工作正常,但在KitKat通知栏中覆盖了操作栏。 enter image description here

布局代码如下:

<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity">
<!-- The main content view -->

<!-- Your normal content view -->
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:orientation="vertical">

    <include layout="@layout/base_activity_toolbar" />

    <FrameLayout
        android:id="@+id/frame_base"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>

<fragment
    android:id="@+id/navigation_drawer"
    android:name="com.squad.run.fragments.NavigationDrawerFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:tag="SIDE_MENU"
    tools:layout="@layout/sidemenu_left" />

工具栏代码:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
    android:id="@+id/base_activity_toolbar"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/colorPrimary"
    android:minHeight="?attr/actionBarSize"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />

根据我的阅读设置,根布局中的fitSystemWindows属性设置为True应解决问题。我不确定我在这里做错了什么。

0 个答案:

没有答案
相关问题