Forum Xamarin.Android

Prevent DrawerLayout from Hiding Status Bar when Open

pmhart83pmhart83 USMember ✭✭✭
edited February 2017 in Xamarin.Android

Currently I have a DrawerLayout with a menu layout and a content (detail page) layout. However as I open the menu, the status bar hides. All the things I have been reading online explain how to keep the status bar above the menu / transparent. I have not found any details on keeping the status bar always visible.

I have my views offset from the top by 25 dp. I also have tried setting FitsSystemWindows to true. My views are positioned where I want, but the status bar has a mind of it's own and hides to a black bar when the drawer is open.

The following is my style for the main activity:

<style name="custom" parent="Theme.AppCompat.Light.NoActionBar"> <item name="windowNoTitle">true</item> <item name="windowActionBar">false</item> <item name="android:windowFullscreen">true</item> <item name="android:actionBarSize">0dp</item> <item name="android:buttonStyle">@style/NoShadowButton</item> <item name="android:windowDrawsSystemBarBackgrounds">true</item> </style>

Posts

  • pmhart83pmhart83 USMember ✭✭✭

    Any suggestions? I am still digging deep to fix this.

  • pmhart83pmhart83 USMember ✭✭✭

    OK, this is a non-issue ... it was a deeper code issue unique to my source.

  • KrayemKrayem LYMember ✭✭

    Your style will totally hide the status bar, am i wrong?
    so, to show statusBar over your app's layout you need to inherit style that not prevent statusbar from showing and change windowFullscreen to false

    <style name="custom" parent="Theme.AppCompat.Light.DarkActionBar">
      <item name="windowNoTitle">true</item>
      <item name="windowActionBar">false</item>
      <item name="android:windowFullscreen">false</item>
      <item name="android:actionBarSize">0dp</item>
      <item name="android:buttonStyle">@style/NoShadowButton</item>
      <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    </style>
    
  • pmhart83pmhart83 USMember ✭✭✭
    edited February 2017

    @Krayem said:
    Your style will totally hide the status bar, am i wrong?
    so, to show statusBar over your app's layout you need to inherit style that not prevent statusbar from showing and change windowFullscreen to false

    You are right. Because code from another dev was hiding it I was trying all sorts of stuff.

Sign In or Register to comment.