摘要: 1 /**/ 2 // 设置layer边框 3 self.customView.layer.borderWidth = 10; 4 // 设置layer边框颜色 5 self.customView.layer.borderColor =[UIColor bl... 阅读全文
posted @ 2016-01-23 23:57 xiaocaoera 阅读(452) 评论(0) 推荐(0) 编辑
摘要: 1 self.iconView.layer.borderWidth = 10;2 self.iconView.layer.borderColor = [UIColor purpleColor].CGColor;3 self.iconView.layer.cornerRadius = ... 阅读全文
posted @ 2016-01-23 23:41 xiaocaoera 阅读(536) 评论(0) 推荐(0) 编辑
摘要: 1 #import "NJViewController.h" 2 3 @interface NJViewController () 4 @property (weak, nonatomic) IBOutlet UIView *customView; 5 6 @end 7 8 @impleme... 阅读全文
posted @ 2016-01-23 23:33 xiaocaoera 阅读(335) 评论(0) 推荐(0) 编辑
摘要: 1 #import "NJViewController.h" 2 3 @interface NJViewController () 4 @property (weak, nonatomic) IBOutlet UIImageView *iconView; 5 6 @end 7 8 @impl... 阅读全文
posted @ 2016-01-23 22:34 xiaocaoera 阅读(374) 评论(0) 推荐(0) 编辑
摘要: 1 // 1.创建手势识别器 2 UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] init]; 3 // 1.1设置长按手势识别器的属性 4 // ... 阅读全文
posted @ 2016-01-23 21:58 xiaocaoera 阅读(910) 评论(0) 推荐(0) 编辑
摘要: 1 - (void)viewDidLoad 2 { 3 [super viewDidLoad]; 4 5 // 向上 6 UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] ini... 阅读全文
posted @ 2016-01-23 21:12 xiaocaoera 阅读(498) 评论(0) 推荐(0) 编辑
摘要: 一次完整的触摸事件的传递响应的过程UIAppliction --> UIWiondw -->递归找到最适合处理事件的控件控件调用touches方法-->判断是否实现touches方法-->没有实现默认会将事件传递给上一个响应者-->找到上一个响应者1.响应者链条:由很多响应者链接在一起组合起来的一个... 阅读全文
posted @ 2016-01-23 20:50 xiaocaoera 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 发生触摸事件后,系统会将该事件加入到一个由UIApplication管理的事件队列中UIApplication会从事件队列中取出最前面的事件并将事件分发下去以便处理,通常先发送给应用程序的主窗口(keyWindow)主窗口会在市图层次结构中找到一个最合适的视图来处理触摸事件找到合适的视图控件后,就会... 阅读全文
posted @ 2016-01-23 20:42 xiaocaoera 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 1 #import 2 @class NJLockView; 3 4 @protocol NJLockViewDelegate 5 6 - (void)lockViewDidClick:(NJLockView *)lockView andPwd:(NSString *)pwd;... 阅读全文
posted @ 2016-01-23 20:00 xiaocaoera 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 1 @interface NJView () 2 3 @property (nonatomic, strong) NSMutableArray *paths; 4 5 @end 6 7 @implementation NJView 8 9 - (NSMutableArray *)paths... 阅读全文
posted @ 2016-01-23 19:43 xiaocaoera 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 1 @interface NJView () 2 /** 3 * 定义一个大数组(大数组中保存小数组, 每一个小数组保存一条直线所有的点) 4 */ 5 @property (nonatomic, strong) NSMutableArray *totalPoints; 6 ... 阅读全文
posted @ 2016-01-23 17:34 xiaocaoera 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 1 - (IBAction)captureView:(UIButton *)sender { 2 3 // 延迟1 ~2 秒之后再截屏 4 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NS... 阅读全文
posted @ 2016-01-23 15:51 xiaocaoera 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 1 // 当手指在view上移动的时候调用 2 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event 3 { 4 5 UITouch *touch = [touches anyObject]; 6 ... 阅读全文
posted @ 2016-01-23 15:41 xiaocaoera 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 1 #import 2 3 @interface UIImage (NJ) 4 /** 5 * 生成头像 6 * 7 * @param icon 头像图片名称 8 * @param border 头像边框大小 9 * @param color 头像边框的颜色10 *1... 阅读全文
posted @ 2016-01-23 12:37 xiaocaoera 阅读(363) 评论(0) 推荐(0) 编辑
摘要: 1 - (void)drawRect:(CGRect)rect 2 { 3 // 1.获取上下文 4 CGContextRef ctx = UIGraphicsGetCurrentContext(); 5 6 // 2.创建路径(一个path就代表一条路径) 7 ... 阅读全文
posted @ 2016-01-23 11:48 xiaocaoera 阅读(203) 评论(0) 推荐(0) 编辑