2015年2月17日

KVC 和 KVO

摘要: 1.KVC(key value coding)1.1.基本概念 1> 我们一般是通过set方法或者属性的点语法来直接更改对象的状态,即对象的属性值,比如[stu setAge:29]; stu.age = 30; 2> KVC 它是以间接更改对象状态的方式,其实现方法是使用字符串来描述对象需要... 阅读全文

posted @ 2015-02-17 19:52 雾里寻梦 阅读(273) 评论(0) 推荐(0)

7. Quartz2D 绘制水印

摘要: #import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad{ [super viewDidLoad]; UIImage *i... 阅读全文

posted @ 2015-02-17 19:49 雾里寻梦 阅读(122) 评论(0) 推荐(0)

6. Quartz2D 随机绘制N个五角星

摘要: #import "MyView.h"#pragma mark - 记录五角星5个顶点CGPoint points[5];@interface MyView(){ //判断是否已经计算过顶点 BOOL _hasPoint;}@end@implementation MyView-(void)... 阅读全文

posted @ 2015-02-17 12:39 雾里寻梦 阅读(212) 评论(0) 推荐(0)

5. Quartz2D 绘制图像

摘要: #pragma mark 绘制图像-(void)drawImage:(CGContextRef)context{ UIImage *image = [UIImage imageNamed:@"1.png"]; //提示:绘制之后,就无法改变位置,也没有办法监听手势 ... 阅读全文

posted @ 2015-02-17 12:37 雾里寻梦 阅读(118) 评论(0) 推荐(0)

4. Quartz2D 绘制文字

摘要: #pragma mark 绘制文字(中文)-(void)drawText2:(CGContextRef)context{ NSString *string = @"博阿士大夫撒风景撒开了房间撒"; //1.获取字体 NSLog(@"%@",[UIFont familyNames])... 阅读全文

posted @ 2015-02-17 12:36 雾里寻梦 阅读(287) 评论(0) 推荐(0)

3. Quartz2D 绘制矩形、圆形、弧形

摘要: #pragma mark 绘制圆弧-(void) drawArc:(CGContextRef)context{ //1.设置路径 /** 1)context 上下文 2)x,y 圆弧所在圆的中心点坐标 3)radius 半径 4)startAngle en... 阅读全文

posted @ 2015-02-17 12:35 雾里寻梦 阅读(214) 评论(0) 推荐(0)

1. Quartz2D 基本概念

摘要: 1. Quartz2D 基本概念 阅读全文

posted @ 2015-02-17 11:12 雾里寻梦 阅读(111) 评论(0) 推荐(0)

2. Quartz2D 绘制直线

摘要: #import @interface MyView : UIView@end#import "MyView.h"@implementation MyView-(void) drawRect:(CGRect)rect{ //1.取出上下文 --当前绘图的位置(设备) CGContextRe... 阅读全文

posted @ 2015-02-17 11:10 雾里寻梦 阅读(153) 评论(0) 推荐(0)

导航