首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

xcode4.5画图填充色的有关问题

2013-01-25 
xcode4.5画图填充色的问题XCODE4.5IOS 6.0能画图,填充颜色没效果。代码如下。CGContextRef context UIGrap

xcode4.5画图填充色的问题
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);
这样没问题了

热点排行