我试图在ActionBar
中应用一种样式,改变它的背景和颜色。 这就是NativeScript
文档所说的它应该做的事情......但实际上,当我尝试为这个图标添加样式时,它没有得到我的颜色。
此外,如果我向ActionBar
添加标题,它将继承我的样式并使用我选择的颜色进行渲染。
但它不会发生在行动项目上!
这是我的文件
<template>
<ActionBar>
<NavigationButton ios:visibility="collapsed" icon="res://menu" @tap="onDrawerButtonTap" />
<ActionItem icon="res://menu"
android:visibility="collapsed"
@tap="onDrawerButtonTap"
ios.position="left">
</ActionItem>
<Image class="logo" src="~/images/logo.png"></Image>
</ActionBar>
</template>
<script>
import * as utils from "~/helpers/utils";
export default {
data(){
return {
};
},
methods: {
onDrawerButtonTap() {
utils.showDrawer();
},
}
}
</script>
<style lang="scss" scoped>
@import '../../_app-variables.scss';
ActionBar {
background-color: #c3c3c3;
color: $primary;
}
</style>
有没有有效的方法来更改此sideDrawer
按钮颜色?
尝试在操作栏上将iosIconRenderingMode设置为alwaysTemplate,这应该将图标颜色转换为CSS中指定的颜色。
<ActionBar iosIconRenderingMode="alwaysTemplate">