Tag: motion

如何在button按下之前停止响应?

我目前正在做一个iPhone应用程序,一个animation反应到一个小摇,这是我的代码: static BOOL SJHShaking(UIAcceleration* last, UIAcceleration* current, double threshold) { double deltaX = fabs(last.x – current.x), deltaY = fabs(last.y – current.y), deltaZ = fabs(last.z – current.z); return (deltaX > threshold && deltaY > threshold) || (deltaX > threshold && deltaZ > threshold) || (deltaY > threshold && deltaZ > threshold); } – (id)initWithFrame:(CGRect)frame { if […]