2017年2月27日

摘要: 1,UIView的setNeedsDisplay和setNeedsLayout方法 首先两个方法都是异步执行的。而setNeedsDisplay会调用自动调用drawRect方法,这样可以拿到 UIGraphicsGetCurrentContext,就可以画画了。而setNeedsLayout会默认 阅读全文
posted @ 2017-02-27 17:09 sunny** 阅读(113) 评论(0) 推荐(0) 编辑
 
摘要: 1. initWithFrame方法是什么? initWithFrame方法用来初始化并返回一个新的视图对象,根据指定的CGRect(尺寸)。 当然,其他UI对象,也有initWithFrame方法,但是,我们以UIView为例,来搞清楚initWithFrame方法。 2.什么时候用initWit 阅读全文
posted @ 2017-02-27 17:02 sunny** 阅读(168) 评论(0) 推荐(0) 编辑
 
摘要: - (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if (self) { self.clipsToBounds = YES; [self initCircles]; } return se 阅读全文
posted @ 2017-02-27 16:11 sunny** 阅读(174) 评论(0) 推荐(0) 编辑