【问题标题】:Ionic 3 - Display lock screen when we minimized the appIonic 3 - 当我们最小化应用程序时显示锁定屏幕
【发布时间】:2018-11-20 03:47:38
【问题描述】:

在 Ionic 3 中,如果应用程序被最小化,我们需要显示锁定屏幕,或者如果我们打开任何其他应用程序,则需要进入后台。

谢谢 AK

【问题讨论】:

    标签: background ionic3 lockscreen


    【解决方案1】:

    我知道我们如何实现上述逻辑。

      platform.pause.subscribe(() => {
            //logic when the application is in the background
            this.navCtrl.push(LockScreenPage);
          });
    
          platform.resume.subscribe(() => {
            //logic when the application has been resumed after being paused.
    
          });
    

    但是任何人都知道我们可以在应用程序中的哪个位置使用它,因为我的应用程序中有 16 个页面。如果我创建 BaseApp 并扩展所有 16 个页面,则此代码将执行 16 次。实现此逻辑的任何其他方式。可以在component.ts中使用吗?

    【讨论】:

    • 添加到app.component
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-19
    相关资源
    最近更新 更多