【问题标题】:How to show popup on top of all other apps in ionic 3如何在ionic 3中的所有其他应用程序之上显示弹出窗口
【发布时间】:2018-09-28 05:13:03
【问题描述】:

我正在构建一个用于练习 ionic 的测试应用,我需要在其中添加类似 Whatsapp 弹出窗口之类的功能。

我知道我可以使用system_alert_window

但我将 ionic 3 与 Cordova 一起使用。我怎样才能实现它?

【问题讨论】:

  • 你有没有找到关于这个的东西,我也有同样的问题?

标签: angular typescript ionic-framework ionic3


【解决方案1】:

您可以在 ionic3 中使用警报控制器

import { AlertController } from 'ionic-angular';

constructor(private alertCtrl: AlertController) {

}

presentAlert() {
  let alert = this.alertCtrl.create({
    title: 'Low battery',
    subTitle: '10% of battery remaining',
    buttons: ['Dismiss']
  });
  alert.present();
}

presentConfirm() {
  let alert = this.alertCtrl.create({
    title: 'Confirm purchase',
    message: 'Do you want to buy this book?',
    buttons: [
      {
        text: 'Cancel',
        role: 'cancel',
        handler: () => {
          console.log('Cancel clicked');
        }
      },
      {
        text: 'Buy',
        handler: () => {
          console.log('Buy clicked');
        }
      }
    ]
  });
  alert.present();
}

您可以在此处阅读更多相关信息: https://ionicframework.com/docs/api/components/alert/AlertController/

【讨论】:

  • 注意标题 - “在所有其他应用程序之上”因此投反对票。
猜你喜欢
  • 2018-07-17
  • 1970-01-01
  • 2013-11-30
  • 1970-01-01
  • 2014-09-09
  • 1970-01-01
  • 1970-01-01
  • 2010-12-27
  • 1970-01-01
相关资源
最近更新 更多