我有一個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