iPhone App增加Shake手势灵敏度 [英] iPhone App increase Shake gesture Sensitivity

查看:155
本文介绍了iPhone App增加Shake手势灵敏度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的iPhone应用程序中,我使用摇动手势它正在工作,但它需要付出很多努力来撼动

In my iPhone App I have used shake gesture it is working but it requires lots of efforts to shake

有没有办法让它更敏感或增加灵敏度?

Is there any way to make it more sensitive or increase the sensitivity?

这里是代码

 - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
 {
      if (motion == UIEventSubtypeMotionShake)
      {
          [self performSelector:@selector(startPressed:)];  
      }
 } 

请帮助和建议。

谢谢

推荐答案

就我所知,这不是直接做到这一点的方法。

The isnt a way to do it directly as far as I'm aware.

解决这个问题的一种方法是使用加速度计的读数,然后自己决定是否有震动,你可以自己进行微调。所以。

One way to get around this would be to use the accelerometer's readings, and then decide for yourself if it was a shake, you would be able to fine tune it yourself if so.

这篇关于iPhone App增加Shake手势灵敏度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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