android - A blank bar appear at bottom when using translucent status bar in non-actionbar activity? -


i want use toolbar instead of actionbar translucent status bar, thin bar(the same status bar in width) appears @ bottom of screen if i'm using noacitionbar theme. , color of bar same 'windowbackgroud' set. guess there's margin or something.

i tried reset margins didn't work. , when use 'android device monitor' in android studio check hierarchy of ui bar disappears, re-disapear when restart app.

i'm using appcompat v22 support lib , activity appcompat activity.

i override function in mainacitivity:

@override public void onwindowfocuschanged(boolean hasfocus) {     super.onwindowfocuschanged(hasfocus);     if(hasfocus){         if(build.version.sdk_int >= build.version_codes.kitkat){             // translucent status bar             getwindow().addflags(windowmanager.layoutparams.flag_translucent_status);             // translucent navigation bar             getwindow().addflags(windowmanager.layoutparams.flag_translucent_navigation);         }     } } 

in mainacitvity there's fragment :

<fragment xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/main_fragment" android:name="org.bitoo.abit.ui.mainactivityfragment" tools:layout="@layout/fragment_mission_list" android:layout_width="match_parent" android:layout_height="match_parent" /> 

and layout of fragment here:

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"          xmlns:tools="http://schemas.android.com/tools"          xmlns:materialdesign="http://schemas.android.com/apk/res-auto"          android:layout_width="match_parent"          android:layout_height="match_parent"             android:background="@color/light_primary_color"          tools:context="org.bitoo.abit.ui.detailedmissionactivityfragment">  <android.support.v7.widget.recyclerview     android:id="@+id/rv_mission_list"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:scrollbars="vertical"/>   <com.gc.materialdesign.views.buttonfloat     android:id="@+id/bt_add"     android:layout_width="60dp"     android:layout_height="60dp"     android:layout_margin="15dp"     android:layout_alignparentright="true"     android:layout_alignparentend="true"     android:layout_alignparentbottom="true"     android:background="@color/accent_color"     materialdesign:animate="false"     materialdesign:icondrawable="@drawable/ic_action_new" />  </relativelayout> 

style of theme :

  <style name="apptheme" parent="theme.appcompat.light.darkactionbar">     <item name="actionbarstyle">@style/my_actionbar_style</item>     <item name="colorprimary">@color/primary_color</item>     <item name="colorprimarydark">@color/dark_primary_color</item>   </style>  <style name="my_actionbar_style" parent="widget.appcompat.actionbar">     <item name="background">@color/dark_primary_color</item>     <item name="backgroundstacked">@color/dark_primary_color</item>     <item name="backgroundsplit">@color/dark_primary_color</item>     <item name="titletextstyle">@style/my_actionbar_text_style</item> </style> <style name="my_actionbar_text_style" parent="textappearance.appcompat.widget.actionbar.title">     <item name="android:textcolor">@color/title_text_color</item> </style> 


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -