本文介绍了如何一次检测iphone的摇动手势!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望iphone只检测一次摇动手势.
hi i want iphone detect shake gesture only one time .
在iPhone摇动并显示html文件后,然后我希望iPhone不再检测到摇动.
after iphone had been shaken and html files showed , then i want iphone doesn't detect shake anymore .
这是我的代码:
- (void)accelerometer:(UIAccelerometer *)accelerometer
didAccelerate:(UIAcceleration *)acceleration {
{
if (acceleration.x > kAccelerationThreshold
|| acceleration.y > kAccelerationThreshold
|| acceleration.z > kAccelerationThreshold) {
}
}
}
推荐答案
删除委托:
[UIAccelerometer sharedAccelerometer].delegate = nil;
这篇关于如何一次检测iphone的摇动手势!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!