Cordova收听iOS主页按钮按下
Cordova Listen to iOS home button press
有没有一种方法可以使用PhoneGap/Cordova在iOS设备中收听主页按钮按下?
在iOS中,它像这样完成
- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
收听暂停事件工作
document.addEventListener("pause", yourCallbackFunction, false);
http://docs.phonegap.com/en/2.9.0rc1/cordova_events_events.md.html#pause
相关文章:
- 当浏览器上的后退按钮到达主页时,我需要删除Class
- 在Phonegap/iOS中按下主页按钮时访问本地存储
- 在Jquery easyui中,多个选项卡提交按钮点击事件正在重定向到主页(第一个)选项卡
- Cordova收听iOS主页按钮按下
- 如何检测是否在主页上隐藏按钮
- HTML Texeare 插入符号控件使用左、右、下、上、主页和结束虚拟按钮
- WebView中的Html页不会激发'可见性更改'用户按下主页按钮时的事件(iOS 8)
- ESRI 自定义主页按钮 GIS JavaScript
- 将复选框和按钮组合在同一个 CSS 主页菜单中
- JQuery 添加“滚动”按钮,并在有新数据可用时刷新主页
- 代码镜像 - 覆盖主页/结束按钮以正常工作
- 任何在Phonegap中跟踪主页按钮按下事件的可能性
- 检测 iOS 相对于 JavaScript 中主页按钮的方向
- 在 Ionic 的标题栏中动态显示主页按钮
- 如何用按钮关闭主页中的ajaxi页面
- 用户单击PageBack按钮后,主页按钮丢失
- 如何从上一页导航回主页按钮
- 从浏览器检测iPad上的主页按钮点击事件
- 输入焦点后触发主页按钮
- Ui-router返回主页按钮