有没有办法在ionic 2 toast中样式文本消息?
我已经尝试过这个:
let toast = Toast.create({
message: "Some text on one line. <br /><br /> Some text on another line.",
duration: 15000,
showCloseButton: true,
closeButtonText: 'Got it!',
dismissOnPageChange: true
});
toast.onDismiss(() => {
console.log('Dismissed toast');
});
this.nav.present(toast);
}
但显然您不能在文本中使用 html,所以我猜我的问题的答案是否定的?
<br />
将不起作用。 - Ari!important
来使text-align:center
生效:text-align:center !important;
否则它将不起作用! - Hamid Araghi