Bala
Bala

Reputation: 71

how to change the status bar color to transparent for splash screen using nativescript?

enter image description hereHow to change the status bar icon color for splash screen (LaunchScreenTheme) in android ?

I tried the below code but it's not working .

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

<style name="LaunchScreenTheme" parent="LaunchScreenThemeBase">
        <item name="android:windowActionBarOverlay">false</item>  
        <item name="android:windowTranslucentStatus">false</item>
        <item name="colorPrimaryDark">@color/ns_ThemeBase</item>
    </style>

How to change the status bar background to white and the icons to black ?

Upvotes: 3

Views: 6012

Answers (2)

Bala
Bala

Reputation: 71

enter image description here

This is what i actually looked for and i achieved it by using the code

<style name="LaunchScreenTheme" parent="LaunchScreenThemeBase">
        <item name="android:windowActionBarOverlay">false</item>  
        <item name="android:windowTranslucentStatus">false</item>
        <item name="android:windowLightStatusBar">true</item>
        <item name="colorPrimaryDark">@color/ns_ThemeBase</item>
    </style>

Thanks for all your support , Cheers :)

Upvotes: 2

micster
micster

Reputation: 758

If it helps, I wasn't able to make status bar transparent, my workaround is to hide it.

Try to add those two lines in your style :

<item name="android:windowFullscreen">true</item>
<item name="windowActionBar">false</item>

You should have this (styles.xml) :

<!-- Launch Screen -->
<style name="LaunchScreenTheme" parent="LaunchScreenThemeBase">
    <item name="android:windowActionBarOverlay">false</item>
    <item name="android:windowTranslucentStatus">false</item>
    <item name="colorPrimaryDark">@color/ns_ThemeBase</item>
    <item name="android:windowFullscreen">true</item>
    <item name="windowActionBar">false</item>
</style>

Working example : https://github.com/mickaeleuranie/nativescript-stackoverflow-49236235

How it looks : https://imgur.com/y2QXvlI

Upvotes: 4

Related Questions