question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Statusbar - How to achieve white background and black icons?

See original GitHub issue

Just can’t seem to get it right. I have <color name="primary_dark">#ffffff</color> In my colors.xml to make the background white, but the icons are also white.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

20reactions
ramonsenadevcommented, Mar 23, 2018

To getting white background and black icons (dark-content), you will need to change the following file: android/app/src/main/res/values/styles.xml

Add the code bellow:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
  <item name="android:windowLightStatusBar">true</item>
  <item name="android:statusBarColor">#ffffff</item>
</style>
1reaction
PABourdaiscommented, Nov 4, 2021

Add colorPrimaryDark item in your current splash theme in styles.xml :

<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
	<item name="colorPrimaryDark">@color/statusbar_bg</item>
	<item name="android:windowLightStatusBar">true</item>
</style>

Add inside ressources in colors.xml:

<color name="statusbar_bg">#FFFFFF</color>

Then use it as a second parameter while showing SplashScreen in MainActivity.java:

public class MainActivity extends ReactActivity {
    
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		SplashScreen.show(this, R.style.SplashTheme);
		super.onCreate(savedInstanceState);
        }
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I make the status bar white with black icons?
With Android M (api level 23) you can achieve this from theme with android:windowLightStatusBar attribute. Edit : Just as Pdroid mentioned, this can...
Read more >
How to change white background with black icon of actionbar and ...
How to change white background with black icon of actionbar and statusbar in Android? 488 views 1 year ago. Groodeals. Groodeals. 56 subscribers....
Read more >
The status bar icons have turned black ONLY on the home ...
The first suggested fix worked. Long press on the home screen and then select settings, then uncheck personalized updates. This restored the icons...
Read more >
Android – How to make the status bar white with black icons
With Android M (api level 23) you can achieve this from theme with android:windowLightStatusBar attribute. Edit : Just as Pdroid mentioned, this can...
Read more >
Setting Android Status Bar Background & Icon Colors
Modern apps will set the status bar to match the background color when toggling between light and dark. Since we are allowing the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found