2014-01-10 61 views
0

我想要确定摇动手势以及设备的左右上下方向。我使用我如何确定在ios上左右上下摇动手势?

-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration方法

,但我没有得到的抖动此方法的方向。 任何人都可以提出任何算法或通过它可以检测到的东西。

感谢

+0

我相信你需要为这个核心运动框架阅读用于本教程。 – Bamsworld

+0

http://stackoverflow.com/questions/6223296/how-to-detect-direction-of-shake-in-iphone http://stackoverflow.com/questions/7253058/horizo​​ntal-and-verticle-shake-count-使用加速度计在iphone-ipad http://stackoverflow.com/questions/1018770/how-to-determine-the-direction-of-a-iphone-shake – Vincent

+0

@Vincent能够检测左右运动,但不会上下,而且在向上和向右运动时都很难检测到。 – Dhara

回答

相关问题