【问题标题】:Ionic 3 popup color changeIonic 3 弹出颜色变化
【发布时间】:2018-11-03 20:12:10
【问题描述】:

我需要更改我的警报弹出窗口的css,这意味着我想将标题颜色更改为白色并将背景颜色更改为灰色。任何人都可以帮助这怎么可能?谢谢。

 presentPrompt() {
  let alert = this.alertCtrl.create({
    title: 'Add Your Question',
    inputs: [
      {
        name: 'would',
        placeholder: 'Would You ',
      },
      {
        name: 'rather',
        placeholder: 'Rather'
      }
    ],
    buttons: [
      {
        text: 'Add',
        role: 'add',
        handler: data => {
          this.wouldquestion = data.would;
          this.ratherquestion = data.rather;
          this.afd.list("Questions/").push({
            would:this.wouldquestion,
            rather:this.ratherquestion,
            ratherclick:this.ratherclicks,
            wouldclick:this.wouldclicks
          });
        }
      },
          ]
  });
  alert.present();
}

【问题讨论】:

  • 您希望整个弹出窗口的背景或仅标题的背景发生变化?
  • 是的,有可能。你是想只弹出这个弹出窗口还是弹出所有应用程序
  • 只有这个弹出窗口。更改整个弹出窗口的背景颜色

标签: ionic-framework sass ionic3


【解决方案1】:
try 
add app.scss
.alertCustomCss {
        color: #e37b26; // text color for basic alerts
        button {
            color: white !important;
            background-color: color($colors, primary, base) !important;
        }
        .alert-message {
            color: #e37b26; // text color for confirm alerts
            // background-color: color($colors, primary, base) !important;
        }
        .alert-sub-title {
          color: #e37b26; // text color for confirm alerts
        //   background-color: color($colors, primary, base) !important;
        }
        .alert-wrapper {
            background-color: color($colors, gray, base);
        }
        .alert-input {
            color: black;
        }
      }

【讨论】:

  • cssClass: 'alertCustomCss'
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-08-03
  • 1970-01-01
  • 2019-02-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多