我正在使用UIPanGesture返回velocityInView,并且从我收集的数据中推测它应该是每秒返回的点数。我得到的数字是数亿和很多零......我没有在模拟器中快速移动我的鼠标。iOS - 使UIPanGesture上的velocityInView有意义
我认为...
在此先感谢您的任何帮助/建议。
编辑:请求代码。
显示/呼叫
-(void)handlePanGesture:(UIPanGestureRecognizer *) recognizer
{
if (recognizer.state == UIGestureRecognizerStateChanged ||
recognizer.state == UIGestureRecognizerStateBegan)
{
CGPoint vel = [recognizer velocityInView:myScrollView];
//[self doSpinAnimationWithVelocity:vel.x];
NSLog([NSString stringWithFormat:@"Velocity - X-Axis - %d ", vel.x]);
NSLog([NSString stringWithFormat:@"Velocity - Y-Axis - %d ", vel.y]);
}
}
Image here of output since I'm still below 10 rep
如果它有所作为,我现在只捕获x轴。 – Mytheral 2011-02-02 19:27:10
y轴也给出了类似的信息。 – Mytheral 2011-02-02 19:28:59
显示您调用velocityInView的代码以及您如何显示数字。 – Anna 2011-02-02 19:35:07