nativescript - 如何使用 nativescript angular 和主题生成器设置 tabItem 样式?
问题描述
我使用标签导航模板创建了 Nativescript Angular 应用程序。该模板创建了以下内容app.component.html
:
<TabView androidTabsPosition="bottom" class="tab-view">
<page-router-outlet
*tabItem="{title: 'People', iconSource: getIconSource('home')}"
name="homeTab">
</page-router-outlet>
<page-router-outlet
*tabItem="{title: 'Events', iconSource: getIconSource('search')}"
name="browseTab">
</page-router-outlet>
<page-router-outlet
*tabItem="{title: 'Tags', iconSource: getIconSource('browse')}"
name="searchTab">
</page-router-outlet>
</TabView>
我在https://www.nativescriptthemebuilder.com/.css
使用主题生成器创建了文件,该文件生成了这部分:
.tab-view {
selected-tab-text-color: #ffffff;
}
.tab-view {
tab-text-color: #ffffff;
}
.tab-view {
tab-background-color: #823551;
}
.tab-view {
android-selected-tab-highlight-color: #d6c7d1;
}
有将 CSS 类添加到本机元素的说明,所以我添加了tab-view
类,如您在第一个片段中看到的那样。但是选项卡的文本颜色和所选选项卡的文本颜色不会更改,并且与主题生成器的颜色不匹配。我发现的所有示例都是用于xml
视图或不使用*tabItem
指令。
因此,要么 Nativescript 的主题构建器不适用于 Nativescript 自己的应用程序模板,要么我做错了什么。我是否忘记或错过了此配置中的某些内容?
解决方案
推荐阅读
- ssh - Can I use ssh-keygen and cfssl interchangeably for ssh login?
- android - Is there a Jetpack Compose equivalent of A password field with the password visible to the user?
- magento2 - Magento 2, warranty and returns verbiage
- python - Python: ModuleNotFoundError despite module being installed
- python - Converting .txt file to CSV
- python - 与 Python 的 Hashlib 或 Crypto++ 相比,RustsCrypto 的性能不佳
- java - 如何在 Java(Linux 和 Windows)中使用操作系统的默认文件选择器
- dart - 用 File 的具体实现扩展一个类
- docker - 如何将 docker 镜像推送到 moto 服务器中的 ecr repo
- reactjs - TypeError:无法读取未定义的属性“clickNode”