objective c - Is drawRect really changing the background color of a NSView? -
everywhere on net can read alter background color of nsview can override method drawrect this:
- (void)drawrect:(nsrect)rect { [[nscolor yellowcolor] set]; nsrectfill(rect); } for illustration here.
however, in case, color drawn on top of view (i can't see anymore content), quite logical me. drawrect supposed draw view, not background.
what missing?
you should phone call [super drawrect:rect] after filling background. otherwise, you're replacing drawn superclass's implementation.
objective-c cocoa
No comments:
Post a Comment