java - Issue between android:windowLightStatusBar and Navigation Drawer -
i have set android:windowlightstatusbar
true
display black icons , text on status bar inside app picture below.
however, navigation drawer no longer fit screen, see picture below. because ensure android:windowlightstatusbar
works, android:windowtranslucentstatus
must set false. workaround? app google calendar seem work fine feature.
here's main activity's 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>
remove line layout.xml
android:fitssystemwindows="true"
and add styles-v21.xml
<style name="apptheme.noactionbar"> <item name="windowactionbar">false</item> <item name="windownotitle">true</item> <item name="android:windowdrawssystembarbackgrounds">true</item> <item name="android:statusbarcolor">@android:color/transparent</item> </style>
in styles.xml
<style name="apptheme.noactionbar"> <item name="windowactionbar">false</item> <item name="windownotitle">true</item> </style>
in manifest.xml
add in activity main
android:theme="@style/apptheme.noactionbar"
and wrap appbarlayout
tag this:
<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:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:context=".mainactivity"> <!-- here appbarlayout ecc --> </android.support.design.widget.coordinatorlayout> <!-- here navigationview ecc -->
appbarlayout must have
android:theme="@style/apptheme.appbaroverlay"
Comments
Post a Comment