1
votes

I'm totally new in Nativescript. I'm from the android background and need to know how can I remove splash screen and Actionbar?

Currently, my theme is

<style name="AppThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">@color/ns_primary</item>
        <item name="colorPrimaryDark">@color/ns_primaryDark</item>
        <item name="colorAccent">@color/ns_accent</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowActionBar">false</item>
</style>

Is there a way to always disable default action bar?

2

2 Answers

1
votes

1 - To hide it with a theme:

// add to main Activity in mainafest.xml
android:theme="@style/Theme.NoActionBar" 
// or refrence your custom theme
android:theme="@style/#you-theme"

2 - To hide it per page: if you use nativescript core

<Page xmlns="http://www.nativescript.org/tns.xsd" actionBarHidden="true"></Page>

if you use angular version

import {Page} from "ui/page";
export class AppComponent {
     constructor(privte page: Page) {
          this.page.actionBarHidden = true;
     }
}
0
votes

You could simply set actionBarVisibility to never on your Frame to hide the ActionBar Or to hide it on Page level set actionBarHidden on Page

Regarding eliminating the splash image, remove this meta tag from your AndroidManifest.xml

<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />

And update theme on your NativeScript Activity from LaunchScreenTheme to AppTheme

<activity android:name="com.tns.NativeScriptActivity" 
        android:theme="@style/AppTheme">