【问题标题】:unable to change ion-header's Background-Color in Ionic2无法在 Ionic2 中更改离子头的背景颜色
【发布时间】:2016-12-21 22:09:28
【问题描述】:

我有一个 Ionic2 项目,我想将 ion-header 更改为背景色。 我已经尝试过[ngStyle]、CSS 选择器和 ETC...

这里是项目: https://github.com/eshk12/Parabi/tree/Medicine-Component-Created 代码如下:

https://github.com/eshk12/Parabi/blob/Medicine-Component-Created/src/pages/Medicine/Medicine.html

感谢你们的帮助!

【问题讨论】:

    标签: angular ionic2


    【解决方案1】:
    1. 首先将你的颜色添加到 src/theme/variables.scss

      示例:

      $colors: ( ..., blusky: #87CEEB);

    2. ion-toolbar 标签添加颜色

      示例:

      <ion-navbar color="blusky">

      </ion-ion-navbar>

    【讨论】:

    • 感谢您的帮助!
    【解决方案2】:

    我发现了如何解决这个问题, 只需将这些行添加到 css 文件中:

    .toolbar-background{ background-color:#375faf; }

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-07-27
    • 1970-01-01
    • 2020-01-20
    • 2020-09-15
    • 2017-09-25
    • 2013-03-14
    • 2016-10-04
    • 2014-09-25
    相关资源
    最近更新 更多