react-native-splash-screen icon indicating copy to clipboard operation
react-native-splash-screen copied to clipboard

Statusbar - How to achieve white background and black icons?

Open TsuryKnox opened this issue 8 years ago • 7 comments

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.

TsuryKnox avatar Dec 13 '17 14:12 TsuryKnox

me too, do you solve the problem?

25juan avatar Jan 05 '18 05:01 25juan

No, I have not...

TsuryKnox avatar Jan 07 '18 12:01 TsuryKnox

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>

ramonsenadev avatar Mar 22 '18 20:03 ramonsenadev

Hey @ramonsenadev , it's working , Thanks

tong233 avatar Apr 17 '18 10:04 tong233

@ramonsenadev brilliant, this should be added to the readme file.

Dror-Bar avatar Jun 30 '19 08:06 Dror-Bar

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);
        }
    }

PABourdais avatar Nov 04 '21 09:11 PABourdais

Thanks ,its working!

innerPeaceG21 avatar Oct 11 '22 21:10 innerPeaceG21