最小化iOS-Phonegap / Cordova应用程序 [英] minimize iOS-Phonegap/Cordova App

查看:360
本文介绍了最小化iOS-Phonegap / Cordova应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Phonegap Javascript应用程式中,使用 navigator.app.exitApp();

In a Phonegap Javascript app I close the Android Version of this app with navigator.app.exitApp();

我们知道,iOS中不允许关闭应用程式。
但是iPad用户可以将应用程序最小化到后台。

As we know, closing apps is not allowed in iOS. But the iPad User can minimize the app into the background e.g. by swiping.

两个问题:


  1. Is it possible that I could minimize the app programmatically?

用户最小化应用程序时是否有事件?

Is there an event when the user minimizes the app?


推荐答案

这关系到你的观点Nr 2:当应用程序被最小化,即放到背景,pause事件被触发,可以处理。请参阅文档中的详细信息: http://docs.phonegap.com /en/2.2.0/cordova_events_events.md.html#pause

This concerns your point Nr 2: When the App is minimized, i.e. put to the background, the "pause" Event is fired and can be handled. See details in the documentation: http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#pause

[UPDATE]:这涉及到Nr.1:你可以写一个phonegap插件让我们调用另一个意图,即主屏幕,这将自动将您的应用程序在后台,而不终止它。另请参见使用Phonegap暂停Android应用

[UPDATE]: This concerns Nr.1: you could write a phonegap plugin that let's you call another intent, i.e. the Home Screen, which would automatically put your app into background, without terminating it. See also Pause an Android App with Phonegap

这篇关于最小化iOS-Phonegap / Cordova应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆