更改 ionic 中所有页面的导航栏颜色 [英] Change NavBar color for all the pages in ionic

查看:23
本文介绍了更改 ionic 中所有页面的导航栏颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 ionic 新手,想学习它.我的问题是如何更改 ionic 3 中所有页面的导航栏颜色.

I am new in ionic and wants to learn it. my question is How to change nav bar color for all the pages in ionic 3.

我一直在使用以下代码

<ion-header>
  <ion-navbar color="primary">
    <button ion-button menuToggle>
      <ion-icon name="menu"></ion-icon>
    </button>
    <ion-title>Hello Ionic</ion-title>
  </ion-navbar>
</ion-header>

有什么方法可以改变所有页面的导航栏颜色,而不是手动执行 <ion-navbar color="primary">

Is there any way to change nav bar color for all the pages instead of manually doing <ion-navbar color="primary">

推荐答案

将以下行添加到 variables.scss 文件以全局更改颜色.

Add following line to variables.scss file to change the color globally.

$toolbar-background: #3D9BDD;

这篇关于更改 ionic 中所有页面的导航栏颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆