【发布时间】:2018-03-01 07:20:50
【问题描述】:
是否可以在 Ionic2 中更改警报(确定、取消)按钮的颜色?我们可以使用cssClass 属性为按钮着色吗?
.buttonCss{
button{
color:#e74c3c !important;
}
}
上面的代码为 Ok 和 Cancel 按钮提供了相同的颜色,如下图所示
任何帮助表示赞赏...!
编辑1:添加showAlert()函数
showAlert(title, message, yesHandler, noHandler, caller) {
let alert = this.alertCtrl.create({
title: title || "Please Confirm",
message: message,
cssClass:'buttonCss',
buttons: [
{
text: 'Exit',
handler: () => yesHandler(caller)
},
{
text: 'Cancel',
role: 'cancel',
handler: () => noHandler(caller)
}
]
});
alert.present();
}
【问题讨论】:
-
@sebaferreras ,你能帮我解决这个问题吗?
-
您只能在该用户在该帖子上添加评论/答案时标记该用户(由于您的评论,我没有收到任何通知,我看到此帖子只是因为我从家里进入页)。关于你的问题,请看看我的回答,如果它对你有用,请告诉我:)
-
@sebaferreras,谢谢你的建议,我会记住的:)。
标签: css angular typescript ionic2 ionic3