摘要:
参考了An iOS 4 iPhone Graphics Drawing Tutorial using Quartz 2D这篇文章,用了30分钟在iPhone上画出了一条直线,核心代码全在drawRect这个方法中:- (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 2.0); CGFloat componets[] = {0.0, 0.0, 1.0, 1.0}; CGColorSpaceRe... 阅读全文