myprecious

2013年2月25日 #

[转] CGContext

摘要: 0CGContextRef context = UIGraphicsGetCurrentContext(); //设置上下文1 CGContextMoveToPoint //开始画线2 CGContextAddLineToPoint// 画直线4 CGContextAddEllipseInRect //画一椭圆4 CGContextSetLineCap// 设置线条终点形状4 CGContextSetLineDash //画虚线4 CGContextAddRect //画一方框4 CGContextStrokeRect// 指定矩形4 CGContextStrokeRectWithWidth 阅读全文

posted @ 2013-02-25 15:37 myprecious 阅读(138) 评论(0) 推荐(0) 编辑

[转]layer 颜色渐变

摘要: View Code 首先添加QuartzCore.framework#import <QuartzCore/QuartzCore.h>//颜色渐变 CAGradientLayer *gradient = [CAGradientLayer layer]; gradient.frame = self.view.bounds; gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor colorWithRed:245.0/255.0 green:140.0/255.0 blue:70.0/255.0 alpha:1] CGC... 阅读全文

posted @ 2013-02-25 15:30 myprecious 阅读(379) 评论(0) 推荐(0) 编辑

[转]NSBundle

摘要: bundle是一个目录,其中包含了程序会使用到的资源. 这些资源包含了如图像,声音,编译好的代码,nib文件(用户也会把bundle称为plug-in). 对应bundle,cocoa提供了类NSBundle.我们的程序是一个bundle. 在Finder中,一个应用程序看上去和其他文件没有什么区别. 但是实际上它是一个包含了nib文件,编译代码,以及其他资源的目录. 我们把这个目录叫做程序的main bundlebundle中的有些资源可以本地化.例如,对于foo.nib,我们可以有两个版本: 一个针对英语用户,一个针对法语用户. 在bundle中就会有两个子目录:English.lproj 阅读全文

posted @ 2013-02-25 14:58 myprecious 阅读(124) 评论(0) 推荐(0) 编辑

导航