摘要: #import <UIKit/UIKit.h>@interface ViewController : UIViewController{ UIImageView *mImageView;}@end #import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad{ [super viewDidLoad]; mImageView = [[UIImageView alloc] initWithFrame:self.vi 阅读全文
posted @ 2012-07-31 16:32 GreyWolf 阅读(863) 评论(0) 推荐(0) 编辑
摘要: 苹果无敌风火轮如果不是那么酷的话,我们就不需要定制它了。可惜的是,UIActivityIndicator只有一个初始化方法 initWithActivityIndicatorStyle,我们一不能任意改变它的大小——有时候我们需要一个比 UIActivityIndicatorViewStyleWhiteLarge还要更大的无敌风火轮;二,它不够友好——我们需要在风火轮的下面显示一些友好的提示信息。为此,我们不惜代价,自己用一个UIActivityIndicator控件和用Quartz绘图的手段,定制了一个自己的无敌风火轮。#import <Foundation/Foundation.h& 阅读全文
posted @ 2012-07-31 14:53 GreyWolf 阅读(224) 评论(0) 推荐(0) 编辑
摘要: void drawLinearGradient(CGContextRef context, CGRect rect, CGColorRef startColor, CGColorRef endColor){ CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGFloat locations[] = {0.0,1.0}; //颜色所在位置 NSArray *colors = [NSArrayarrayWithObjects:(id)startColor... 阅读全文
posted @ 2012-07-31 12:17 GreyWolf 阅读(988) 评论(0) 推荐(0) 编辑
摘要: 1、绘图总结:绘图前设置:CGContextSetRGBFillColor/CGContextSetFillColorWithColor //填充色CGContextSetRGBStrokeColor/CGContextSetStrokeColorWithColor //笔颜色CGContextSetLineWidth //线宽度绘图后设置:注: 画完图后,必须 先用CGContextStrokePath来描线,即形状,后用CGContextFillPath来填充形状内的颜色.2.常见图形绘制:CGContextFillRect/CGContextFillRectsCGContextFillE 阅读全文
posted @ 2012-07-31 11:00 GreyWolf 阅读(1064) 评论(0) 推荐(0) 编辑