Reputation: 446
I am trying to follow this code example here: https://www.youtube.com/watch?v=NroxMDGOJ_E but it does not work anymore, at least the change status bar color part. The page.androidStatusBarBackground property does not work anymore. Is there a reliable way to change the background color of the statusbar in android using nativescript core?
Upvotes: 1
Views: 723
Reputation: 4152
very simple
App_Resources\Android\src\main\res\values\styles.xml
<style name="LaunchScreenThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
<item name="colorPrimary">@color/ns_primary</item>
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
<item name="colorAccent">@color/ns_accent</item>
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:statusBarColor">@color/ns_primaryDark</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowTranslucentStatus">true</item>
</style>
the important thing is android:statusBarColor
& android:windowLightStatusBar
note : it should work fine, you better delete
platforms
andnode_modules
folder and runtns run android
fresh. It will perfectly work
Upvotes: 1