Android : Toolbar status bar overlapping
Solution 1
as Virus correctly says, the answer is here: Toolbar overlapping below status bar
Simply add the attribute
android:fitsSystemWindows="true"
into the xml item and it will work fine :)
Solution 2
I guess you are using fitSystemWindows
property.
Turn off that.
Solution 3
In order to keep translucent status, you need to have
<item name="android:windowTranslucentStatus">true</item>
Just make the below false
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
and in your parent layout
android:fitsSystemWindows="true"
Solution 4
May be your theme has this
<item name="android:statusBarColor">@android:color/transparent</item>
comment it out
![Sushant kunal](https://i.stack.imgur.com/8VKzn.jpg?s=256&g=1)
Sushant kunal
Updated on June 14, 2022Comments
-
Sushant kunal about 2 years
I am working on creating an app with lollipop toolbar with translucent status bar to have the status bar also tinted. It is working fine with the true property.
It is just that the toolbar is overlapping with the status bar now which looks messy. What is the option to position the toolbar below the status bar with maintaining the window translucent status?
Code Snippets :
<style name="Theme.XXX" parent="Theme.AppCompat"> <item name="colorPrimary">...</item> <item name="colorPrimaryDark">...</item> <item name="android:windowTranslucentStatus">true</item> <item name="windowActionBar">false</item> <item name="colorAccent">...</item> </style>
Toolbar code used in activity:
<android.support.v7.widget.Toolbar android:id="@+id/main_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/XXX" android:elevation="5dp" android:minHeight="?attr/actionBarSize" android:theme="@style/Theme.XXX" />
Thanks in advance.
-
Sushant kunal over 9 yearsThanks but that did not seem to help. I have the following settings in the theme ........<item name="android:windowTranslucentStatus">true</item> <item name="windowActionBar">false</item>......
-
Rensodarwin almost 9 yearsI would not recommend this because there is some side effects with the toast and because the status bar will actually choose a gray color and I'm guessing devs don't want that if they have color for it already. take a better look in this read
-
Parin Parikh about 7 yearsIf i have xaml page than what parameter i have to set?
-
Pepoš IV over 4 yearsSorry, what question do you mean.