XCODE4.5
IOS 6.0
能画图,填充颜色没效果。代码如下。
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor);
CGContextSetLineWidth(context, 1.0);
CGContextMoveToPoint(context, 10, 10);
CGContextAddLineToPoint(context, 10, 100);
CGContextAddLineToPoint(context, 100, 100);
CGContextAddLineToPoint(context, 100, 10);
CGContextAddLineToPoint(context, 10, 10);
CGContextStrokePath(context);
CGContextFillPath(context);
IOS 6.0
能画图,填充颜色没效果。代码如下。
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor);
CGContextSetLineWidth(context, 1.0);
CGContextMoveToPoint(context, 10, 10);
CGContextAddLineToPoint(context, 10, 100);
CGContextAddLineToPoint(context, 100, 100);
CGContextAddLineToPoint(context, 100, 10);
CGContextAddLineToPoint(context, 10, 10);
CGContextStrokePath(context);
CGContextFillPath(context);
解决方案 »
- 想走Iphone开发,求方向,求教材
- 求大神请教 ios opengl es 2.0 有关贴图纹理 vbo的
- IOS网络游戏收费问题?
- [抓狂]读写文件还是想要用FILE,不习惯NSData,NSFileHandle。。。。。
- Objective-C编程之道iOS设计模式子类化单例疑惑
- 求助,iphone 5S被偷还能找回不?
- 如何让lua脚本挂载到一个已有应用上
- 请问如何编码控制Label中文字的位置
- IOS CALayer的anchorpoint属性在官方API中的解释(0,0)坐标是左下角,是错了吧
- ios UIdatepicker 改变字体大小
- 菜鸟求一个 把照片传到服务器的代码!
- 如何实现背景动画效果
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor);
CGContextSetLineWidth(context, 1.0);
CGContextMoveToPoint(context, 10, 10);
CGContextAddLineToPoint(context, 10, 100);
CGContextAddLineToPoint(context, 100, 100);
CGContextAddLineToPoint(context, 100, 10);
CGContextAddLineToPoint(context, 10, 10);
CGContextClosePath(context);
// CGContextStrokePath(context);
CGContextDrawPath(context, kCGPathFillStroke);
这样没问题了