全部得到正确的UIColor,不能在矩形
我有这段代码:
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor);
CGContextFillRect(context, CGRectMake(0, 440, 320, 30));
和我这样称呼它:
_rectangeView = [[PopUpRectangle alloc] initWithFrame:CGRectMake(0, 538, 320, 30)];
但它是黑色的!
任何意见,为什么这是?
在这里'rect'的值是多少?我怀疑你正在着色的那个实际上是出于观点的原因。边界!=帧和所有。 NVM增加了一个答案。 – Fogmeister
是'DrawRect:'有没有叫?放置一个'NSLog()'看看它是否是。 – Popeye