Objective-C 画图

来源:互联网 发布:medline数据库中文 编辑:程序博客网 时间:2024/06/02 13:54
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画图

原创粉丝点击