在后台应用程序时如何检测“摇动手势"? [英] How to detect Shake Gesture while application in Background?

查看:73
本文介绍了在后台应用程序时如何检测“摇动手势"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发音乐播放器应用程序,并且像iPod应用程序一样,我想用摇动手势来随机播放歌曲.

I'm currently working on a music player app, and like the iPod application, I would like to shuffle songs with shake gesture.

我正在实现Apple推荐的运动方法,并且在前台一切正常.

I'm implementing motion methods like Apple recommends to, and in foreground everything works fine.

- (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event;
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event;
- (void)motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event;

但我只是不知道如何从后台调用这些方法.我在互联网上看了很多,对此没有话题.

But I just can't figure out how to call those methods from background. I've looked all over the internet, and there's not threads about this.

第一件事:有可能吗?

感谢!

推荐答案

现在无论使用iOS 4还是更低版本的SDK,都无法实现.

It's not possible now, whether you use iOS 4 or any lower SDK version.

这篇关于在后台应用程序时如何检测“摇动手势"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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