【发布时间】:2010-02-04 02:57:06
【问题描述】:
我有一个 UIView 子类,它在 drawRect 中有以下内容:
for(int j=0; j<[myArray count]; j++){
if([myArray objectAtIndex:j]!=@""){
[[UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1] set];
CGContextFillRect(context, CGRectMake(55+(20*j),10,15,5));
[[UIColor blackColor] set];
[[myArray objectAtIndex:j] drawAtPoint:CGPointMake(55+(20*j),3+) withFont:myFont];
}
}
我已经在 if 语句中登录并且它可以工作,但由于某种原因,我仍然在循环的每次迭代中绘制 CGContextFillRects,即使我当前的数组对象是 @""。
我对绘画还很陌生,所以如果我遗漏了一些重要而琐碎的东西,请见谅。
【问题讨论】:
标签: iphone core-graphics