我有一个UIView
设置为opaque = NO
,它的一切都很好。在drawRect
我在做自定义绘制,这一点也适用在UIView中只有白色填充颜色是透明的
CGContextSetFillColor(context, CGColorGetComponents([UIColor blueColor].CGColor));
CGContextFillRect(context, labelOutside);
CGContextAddRect(context, labelOutside);
但这
CGContextSetFillColor(context, CGColorGetComponents([UIColor whiteColor].CGColor));
CGContextFillRect(context, labelOutside);
CGContextAddRect(context, labelOutside);
导致无填充正在生产(你甚至可以看到,我通过它吸取了CGContext上其他的东西)。我如何绘制白色填充?
注意:如果我设置控件不是不透明,它仍然不起作用。
太棒了,谢谢! 'CGContextSetFillColorWithColor(context,[UIColor whiteColor] .CGColor);' – 2010-09-18 21:09:13
很好的解释谢谢 – 2010-09-26 03:42:38
很好的解释,非常好用。 – CVertex 2014-03-26 06:30:54