nativescript - 工作正常但会导致问题
问题描述
我正在创建 NativeScript - Angular 应用程序。我的应用程序内部路由出现问题,后退按钮不起作用(智能手机中的后退按钮,它应该返回到上一页,但它正在关闭我的应用程序)。
我在我的 app.component.html 文件中使用,所以我将其更改为后退按钮开始按预期工作,但我的主页布局被完全破坏 - 所有对象都重叠在自己身上,并且“预览”ActionBar 出现在之一。
<!-- app.component.html -->
<GridLayout class="page">
<ScrollView>
<GridLayout rows="80 *" columns="*">
<FlexboxLayout class="menu">
<Image class="menu" src="~/app/images/burger.png" width="10%"></Image>
</FlexboxLayout>
<ScrollView></ScrollView>
<GridLayout class="bialy" row="1" rows="*" columns="*">
<FlexboxLayout>
<GridLayout class="space"></GridLayout>
<page-router-outlet></page-router-outlet>
</FlexboxLayout>
</GridLayout>
</GridLayout>
</ScrollView>
</GridLayout>
<!-- app.css -->
GridLayout.page {
background: linear-gradient(-85deg, #08BD73, #02A373);
flex-direction: column;
}
GridLayout.bialy {
background: white;
flex-direction: column;
border-radius: 40 40 0 0;
justify-content: center;
}
<!-- home.component.html -->
<Button text="Add" [nsRouterLink]="['/new']"></Button>
<Button text="Watering" [nsRouterLink]="['/watering']"></Button>
<Button text="catalog" [nsRouterLink]="['/catalog']" ></Button>
我该怎么做才能使我的应用程序与应用程序版本相同
这是带有版本的外观(屏幕 1): 这是带有版本的外观(我希望我的应用程序看起来像这样)(屏幕 2)
解决方案
设置actionBarVisibility
为never
onpage-router-outlet
以隐藏操作栏。
您的 home 组件似乎没有任何布局,这可能是您只看到最后一个按钮的原因,用StackLayout
.
推荐阅读
- android - Kotlin 测试:不能使用提供的参数调用以下函数
- python - 有没有办法使用 datetime64 格式以每月格式对值进行分组?
- python-3.x - 正确陈述归一化混淆矩阵中的值
- c++ - 如何在 C++ 中对向量进行排序
- javascript - bootstrap-datepicker:如何动态更改语言属性?
- c# - Web 界面输入自动化 - > Selenium 是最佳方法吗?
- wordpress - 我需要帮助在 WordPress 存档页面上显示我的自定义分类法吗?
- mysql - 在 MySQL 数据库表中搜索 URL
- javascript - Slack 机器人通过 Amazon S3 发送图像
- kotlin - 如何在 kotlin 中声明 toString 方法?