ionic2 提示内容

constructor(private toastCtrl: ToastController) {

}

presentToast() {
  let toast = this.toastCtrl.create({
    message: 'User was added successfully',
    duration: 3000,
    position: 'top'
  });

  toast.onDidDismiss(() => {
    console.log('Dismissed toast');
  });

  toast.present();
}
属性type默认描述
messagestring-The message for the toast. Long strings will wrap and the toast container will expand.(提示的信息内容)
durationnumber-How many milliseconds to wait before hiding the toast. By default, it will show until dismiss() is called.(多少秒后会自动关闭)
positionstring“bottom”The position of the toast on the screen. Accepted values: “top”, “middle”, “bottom”.(出现在屏蔽中的位置)
cssClassstring-Additional classes for custom styles, separated by spaces.(自定义样式的附加类,由空格分隔。)
showCloseButtonbooleanfalseWhether or not to show a button to close the toast.(是否有关闭按钮)
closeButtonTextstring“Close”Text to display in the close button.(关闭按钮上的字)
dismissOnPageChangebooleanfalseWhether to dismiss the toast when navigating to a new page.(跳转到另一个页面之后提示信息是否马上消失)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值