Statusbar - How to achieve white background and black icons?
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.
me too, do you solve the problem?
No, I have not...
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>
Hey @ramonsenadev , it's working , Thanks
@ramonsenadev brilliant, this should be added to the readme file.
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);
}
}
Thanks ,its working!