How To Make A Transparent Status Bar In Android 4.4?
I want to make a transparent status bar in my application in Android 4.4. How do I do that? I tired:
Solution 1:
This one will throw exception on Lollipop devices. primColor must be opaque.
<item name="primColor">@android:color/transparent</item>
Style your actionbar using style.xml
<stylename="ThemeActionBar"parent="Widget.AppCompat.Light.ActionBar.Solid"><itemname="android:background">@null</item><!-- Support library compatibility --><itemname="background">@null</item></style>
Include you theme..
<itemname="android:actionBarStyle">@style/ThemeActionBar</item><itemname="android:windowActionBarOverlay">true</item><!-- Support library compatibility --><itemname="actionBarStyle">@style/ThemeActionBar</item><itemname="windowActionBarOverlay">true</item>
Solution 2:
What you can also do is set the status bar a darker shade of your background or even the same color by setting it in your activity.
You can set the status bar color in your activity with the following code getWindow().setStatusBarColor(getResources().getColor(R.color.your_color));
.
If you want to use a darker shade of your color you can do it by changing your color's HSB. For a more detailed way of doing that you can read this post: Android change status bar color by converting existing color's HSB
Post a Comment for "How To Make A Transparent Status Bar In Android 4.4?"