我已将
android:windowLightStatusBar
设置为true
,以在我的应用程序中显示黑色图标和状态栏内的文本,如下图所示。
然而,导航抽屉不再适合屏幕大小,如下图所示。这是因为要确保android:windowLightStatusBar
生效,必须将android:windowTranslucentStatus
设置为false。有什么解决办法吗?像Google日历这样的应用程序似乎可以很好地使用此功能。
这是我的主活动XML
<android.support.v4.widget.DrawerLayout 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/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorToolbarBackground"
android:fitsSystemWindows="true"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/app_bar" />
<FrameLayout
android:id="@+id/frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:background="@color/colorWhite"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:menu="@menu/navigation_view_items" />
</android.support.v4.widget.DrawerLayout>