UIImage学习】的更多相关文章

UIImage A UIImage object is a high-level way to display image data. You can create images from files, from Quartz image objects, or from raw image data you receive. The UIImage class also offers several options for drawing images to the current graph…
UIImage是什么 用来管理APP里的图片资源,可以用来表示设备支持的图片资源,不仅仅是jpg和png. UIImage是immutable的,因此也是线程安全的. iOS支持的所有的图片格式 链接 不过,对于gif格式,只能展示第一帧.需要把gif分成若干帧,分别展示. iOS本身的图片缓存系统 iOS本身有一个图像缓存系统.系统在内存不够使,会清除缓存中的一些内容. 使用init(named:in:compatibleWith:)方法生成的image被加入到了系统缓存中去.因此适合于创建频…
UIImage+YYWebImage是YYWebImage(https://github.com/ibireme/YYWebImage)中的一个分类,这个分类封装了一些image常用的变化方法,非常值得学习下源码~(我看的版本是1.0.5)   预备知识: 1,这里大量使用了CoreGraphics的方法,第一个非常常用的的方法就是 UIKIT_EXTERN void    UIGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaq…
UIButton是ios中用来响应用户点击事件的控件.继承自UIControl 1.创建控件 UIButton *button=[UIButton buttonWithType:UIButtonTypeCustom]; 2.设置属性 (1).为按钮上颜色 button.backgroundColor=[UIColor yellowColor]; (2).为按钮设置大小 button.frame=CGRectMake(20, 100, 280, 50); (3)为按钮设置样式 [button se…
之前 做纯色局部拉伸 通过 top  bottom left  right 相交的阴影拉伸 屡试不爽 实施方法: imageView.image = [[UIImage imageNamed: @"icon_helper_palace_day"] resizableImageWithCapInsets:palaceInset]]; 我用这个方法 去拉伸一个 有图案的图的 相对纯色的那一部分时候 会发现 图片被拉伸的同时 会有被图片局部本身填充的现象 好像是连续的同一个1个半的图 这个时…
压缩图片,图片的大小与我们期望的宽高不一致时,我们可以将其处理为我们想要的宽高. 传入想要修改的图片,以及新的尺寸 -(UIImage*)imageWithImage:(UIImage*)image scaledToSize:(CGSize)newSize { // Create a graphics image context UIGraphicsBeginImageContext(newSize); // Tell the old image to draw in this new cont…
iOS学习(UI)知识点整理 一.UI小组件 1.UISegmentedControl 分段选择器  实例代码 - (void)viewDidLoad { [super viewDidLoad]; //分段选择器 //在iOS6里,每个段的宽度会根据字数来决定 //iOS7以后,每个段的宽度相同,宽度取决于最长的字数 self.view.backgroundColor=[UIColor whiteColor]; seg=[[UISegmentedControl alloc]initWithIte…
iOS学习(UI)知识点整理 一.自定义标签栏 1.方法一 单个创建标签栏 #import "AppDelegate.h" #import "SecondViewController.h" #import "ViewController.h" #import "ThirdViewController.h" #import "ForthViewController.h" #import "ViewC…
使用xib自定义tableviewCell看一下效果图 1.自定义列 新建一个xib文件 carTblCell,拖放一个UITableViewCell,再拖放一个图片和一个文本框到tableviewcell上 并给我们的xib一个标识 为了学习,我这里的xib和后台的class是分开建的.我们再建一个cocoa touch class文件名称为CarCellTableViewCell继承自UITableViewCell 并把我们的xib和新建的CarCellTableViewCell建立联接 在…
接上篇.上篇有一个细节忘了写,在Coding_iOS-Info.plist 里面添加了一个key 是 Status bar is initially hidden  Value 是 YES,在application 启动的时候隐藏状态栏,然后在 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ...... // 显示状态栏…