Objective-C 画图

Objective-C 画图


1.颜色和字体
     UIKit提供了UIColor和UIFont类来进行设置颜色和字体,
     UIColor *redColor=【UIColor redColor】;
    【redColor set】;//设置为红色
     UIFont *front=【UIFont systemFontOfSize:14.0】;//获得系统字体
    【myLable setFont:font】;//设置文本对象的字体
 2.drawRect方法
     对于画图,你首先需要重载drawRect方法,然后调用setNeedsDisplay方法让系统画图:
    -(void)drawRect:(CGRect)rect;//在rect指定的区域画图

     -(void)setNeedsDisplay;//让系统调用drawRect画图

posted @ 2015-12-23 21:02  Bo-tree  阅读(205)  评论(0)    收藏  举报