Issue
I have tried tried a few solutions given here but none seems to work for me. This is what I have in my colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#fcfdfb</color>
<color name="colorPrimaryDark">#fff</color>
<color name="colorPrimaryLight">#333</color>
<color name="colorPrimaryText">#333</color>
<color name="colorAccent">#000000</color>
<color name="white">#ffffff</color>
<color name="black">#000000</color>
</resources>
And this is what I have in styles.xml
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@drawable/background_splash</item>
<item name="android:windowActionBar">false</item>
</style>
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@drawable/background_splash</item>
<item name="android:windowActionBar">false</item>
</style>
<style name="ProDialogue" parent="@android:style/Theme.Dialog">
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@color/colorPrimary</item>
<item name="android:textColor">@color/black</item>
</style>
<style name="TransparentToolbar" parent="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:windowActionBarOverlay">true</item>
<item name="windowActionBarOverlay">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
I just need the Statusbar text/icons to be black because I have the background as white to match the content. As a beginner, I am sure that I've messed it up somewhere but hopefully someone will guide me on this. Btw, my minSdkVersion is 21.
Solution
Add these attributes to your theme
<item name="android:windowLightStatusBar">true</item>
<item name="android:statusBarColor">@color/white</item>
Note this only works on 23+, so you'll have to make a 23+ theme file with these attributes. I'm fairly sure that < 23 every device's status bar is black and white and you can't change that, but you should double check
Answered By - George
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.