手势相关操作

新建各种手势: Tap: recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapFrom:)]; Swipe: recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)]; ------------ ----------------- ---------------- ------------------ 复用函数: - (void)showImageWithText:(NSString *)string atPoint:(CGPoint)centerPoint { /* Set the appropriate image for the image view, move the image view to the given point, then dispay it by setting its alpha to 1.0. */ //获取到的图片,显示alpha=1.0.出现在屏幕上 NSString *imageName = [string stringByAppendingString:@".png"]; imageView.image = [UIImage imageNamed:imageName]; imageView.center = centerPoint; imageView.alpha = 1.0; } 这是个可以多次调用的函数,在方法调用的时候,提供图片的名字,(不要后缀),这个函数对后缀自动添加,可以匹配不同的图片. 比如: 设计到不同图片的操作显示. swipe/tap操作后,显示不同的图片, [self showImageWithText:@"tap" atPoint:location]; [self showImageWithText:@"swipe" atPoint:location]; //[recognizer rotation] 是获取旋转角度值 CGAffineTransform transform = CGAffineTransformMakeRotation([recognizer rotation]); //付给可以动画的transform属性 imageView.transform = transform; //没明白这个啥意思? [segmentedControl setExclusiveTouch: YES];

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值