首页 > 解决方案 > 如何从应用程序中删除操作栏?

问题描述

我正在尝试从使用 NativeScript 开发的应用程序中删除操作栏,我删除了与操作栏相关的所有代码(html 和 css 代码),但它继续出现在应用程序上。

HTML:

<ScrollView>
    <StackLayout class="page p-t-15">

            <Image src="~/app/img/logo.png" ></Image>
            <Label class="m-t-10 text-center" text="Login" label.Alignment = "top";></Label>

        <TextField class="m-t-10 m-b-10 m-l-15 m-r-15" hint="Email Address" keyboardType="email" autocorrect="false" autocapitalization="none"
            [(ngModel)]="email"></TextField>

        <TextField class="m-t-10 m-b-10 m-l-15 m-r-15" hint="Password" secure="true" autocorrect="false" autocapitalization="none"
            [(ngModel)]="password"></TextField>

        <Button class="btn btn-primary" text="SIGN IN" (tap)="onSigninButtonTap()"></Button>

        <Label class="m-t-10 text-center" text="______ or ______"></Label>

        <Button class="btn btn-outline" (tap)="onLoginWithSocialProviderButtonTap()" text="Log in with Social Provider"></Button>

        <Label class="m-t-10 m-b-10 m-l-15 m-r-15" text="Forgot password?" (tap)="onForgotPasswordTap()"></Label>

        <Label class="m-t-10 m-b-10 m-l-15 m-r-15" text="Não tem conta?" (tap)="onNaoTemContaTap()"></Label>
        <Button class="btn btn-primary" text="Sign UP" [nsRouterLink]="['/browse']" pageTransition="slide" clearHistory="true"></Button>
    </StackLayout>
</ScrollView>

CSS:

    StackLayout {
    height: 100%;
    width: 100%;
    background-image: linear-gradient(#000000,#439B9B , #000000); 
}

标签: angularnativescriptnativescript-angular

解决方案


使用 NativeScript 5.0,您可以actionBarVisibilityFrame组件上拥有一个新属性。您可以将其设置为,never并且您将永远不会ActionBar在此导航的页面中看到Frame。它消除了ActionBar在每个页面上手动隐藏的需要。

page-router-outletAngular中的组件公开了相同的属性。


推荐阅读