点击手势demo
来源:互联网 发布:cmd 查看80端口占用 编辑:程序博客网 时间:2024/04/25 22:27
<span style="background-color: rgb(153, 153, 255);">//// UIGestureViewController.m// LJEExcise//// Created by xiaoyao on 14/11/29.// Copyright (c) 2014年 lijien. All rights reserved.//#import "UIGestureViewController.h"#define kLABELFRAME (CGRectMake(20, 150, 200, 50))#define kVIEWFRAME (CGRectMake(20, 220, 200, 80))@interface UIGestureViewController () { UILabel *_touchLabel; UIView *_touchView;}@end@implementation UIGestureViewController- (void)viewDidLoad { [super viewDidLoad]; _touchLabel = [[UILabel alloc] initWithFrame:kLABELFRAME]; _touchLabel.backgroundColor = [UIColor blueColor]; _touchLabel.tag = 9999; _touchLabel.textColor = [UIColor redColor]; // 当UI控件不允许用户使用交互属性的时候应当打开其交互 _touchLabel.userInteractionEnabled = YES; // 是否支持多点触碰 _touchLabel.multipleTouchEnabled = YES; [self.view addSubview:_touchLabel]; _touchView = [[UIView alloc] initWithFrame:kVIEWFRAME]; _touchView.backgroundColor = [UIColor purpleColor]; [self.view addSubview:_touchView]; for (int i = 1; i < 6; i++) { UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]; // 连续点击的次数 tap.numberOfTapsRequired = i; // 允许两个手指的触碰 tap.numberOfTouchesRequired = 1; [_touchView addGestureRecognizer:tap]; }}- (void)handleTap:(UITapGestureRecognizer *)tap { // 用户的第几个手指触碰 NSUInteger touchNum = tap.numberOfTouches; NSUInteger tapNum = tap.numberOfTapsRequired; _touchLabel.text = [NSString stringWithFormat:@"tapNum: %lu touchNum: %lu",tapNum, touchNum]; [_touchLabel performSelector:@selector(setText:) withObject:nil afterDelay:2];}- (void)setText:(UILabel *)label { [_touchLabel setText:@"aaa"]; return;}@end</span>
0 0
- 点击手势demo
- 点击手势
- 点击手势
- Android 手势DEMO
- android 手势滑动demo
- 手势监听demo
- ios-手势总结demo
- 手势解锁demo
- Android手势识别Demo
- GestureDetector手势监听Demo
- IOS UIImageView 点击手势
- UI 手势 点击
- 6种手势交互Demo
- iOS UIGestureRecognizer(手势操作)~demo
- iOS手势(拖动,缩放,旋转,点击,手势依赖,自定义手势)
- UIImageView 添加手势实现点击
- Android 屏幕点击手势判断
- 关于手势的点击事件
- 前进气格栅装备有镀铬装饰条
- JavaScript示例十(表单序列化)
- ecllipse pdev不能支持PIL(python image library)的解决方法
- Linux 解压,压缩
- Android代码与webview控件的交互
- 点击手势demo
- 面试中所有二叉树题目总结(java版)
- 如何成为一个linux开发人员
- 使用Eclipse+CDT+MinGW32进行C++开发
- cmd中输入net start mysql 提示:服务名无效 请键入NET HELPING 2185以获得更多的帮助
- UML 之 四种关系
- CSS样式(背景、文本、字体)学习笔记
- UVA 12558 Egyptian Fractions (HARD version) IDA*
- js跨域提交表单【详细教程,包解决】