iPhone SDK 3.2 手势识别
2010-02-08 01:34:00 来源:WEB开发网- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
// Disallow recognition of tap gestures in the segmented control.
if ((touch.view == segmentedControl) && (gestureRecognizer == tapRecognizer)) {
return NO;
}
return YES;
}
- (void)handleSwipeFrom:(UISwipeGestureRecognizer *)recognizer {
CGPoint location = [recognizer locationInView:self.view];
[self showImageWithText:@"swipe" atPoint:location];
if (recognizer.direction == UISwipeGestureRecognizerDirectionLeft) {
location.x -= 220.0;
}
else {
location.x += 220.0;
}
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.55];
imageView.alpha = 0.0;
imageView.center = location;
[UIView commitAnimations];
}
- (void)handleRotationFrom:(UIRotationGestureRecognizer *)recognizer {
CGPoint location = [recognizer locationInView:self.view];
CGAffineTransform transform = CGAffineTransformMakeRotation([recognizer rotation]);
imageView.transform = transform;
[self showImageWithText:@"rotation" atPoint:location];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.65];
imageView.alpha = 0.0;
imageView.transform = CGAffineTransformIdentity;
[UIView commitAnimations];
}
- (void)handleTapFrom:(UITapGestureRecognizer *)recognizer {
CGPoint location = [recognizer locationInView:self.view];
[self showImageWithText:@"tap" atPoint:location];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
imageView.alpha = 0.0;
[UIView commitAnimations];
}
- ››iphone图片拉伸的几种方法
- ››iphone正则表达式的简单使用
- ››iPhone开发Unresolved Symbols CAKeyframeAnimati...
- ››IPhone开发-“此证书是由未知颁发机构签名”解决方...
- ››IPhone开发-整合私钥和证书,生成.p12文件
- ››iPhone应用开发-UIPickerView选取器详解
- ››iphone 获取屏幕的宽度和高度
- ››iPhone读取工程包中的二进制文件
- ››iPhone新手机 不挂YouTube APP
- ››iPhone 获取指定格式的时间和日期
- ››iPhone版PPS走进生活 观赏体验媲美PC版
- ››iPhone两种不同的应用程序:两种方法的哲学思想
更多精彩
赞助商链接