大家好,应用中有一个drawRect,我想给指定的矩形区域上颜色,怎么实现?目前我用的方法:
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [UIColor colorWithWhite:29/255.f alpha:1.0].CGColor);
CGContextFillRect(context, rect);
}
没有任何实现效果。