iphone开发笔记和技巧.docxVIP

  • 1
  • 0
  • 约2.48万字
  • 约 37页
  • 2017-02-01 发布于北京
  • 举报
iphone开发笔记和技巧

iphone程序中实现截屏的一种方法在iphone程序中实现截屏的一种方法://导入头文件#import QuartzCore/QuartzCore.h//将整个self.view大小的图层形式创建一张图片image UIGraphicsBeginImageContext(self.view.bounds.size);[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];UIImage*image=UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();//然后将该图片保存到图片图UIImageWriteToSavedPhotosAlbum(image,self,nil,nil)Objective-C 画图1.颜色和字体UIKit提供了UIColor和UIFont类来进行设置颜色和字体,UIColor *redColor=【UIColor redColor】;【redColor set】;//设置为红色UIFont *front=【UIFont systemFontOfSize:14.0】;//获得系统字体【myLable setFont:font】;//设置文本对象的字体2.drawRect方法对于画图,你首先需要重载d

文档评论(0)

1亿VIP精品文档

相关文档