Question

I want to set a background color to a view and as of now I have subclassed that view in Xib and in drawRect method I am setting the color.

- (void)drawRect:(NSRect)dirtyRect {
    [[NSColor blackColor] setFill];
    NSRectFill(dirtyRect);
    [super drawRect:dirtyRect];
}

Am using [self.view enterFullScreenMode:screen withOptions:nil]; to show the view(which contains an image) in fullscreen. But when view is in fullscreen it shows a default gray background instead of black color. How can I set the background to black ?

Was it helpful?

Solution

Are you sure your methods calling? Put a NSLog to make sure.

If it is, then delete the line [super drawRect:dirtyRect];

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top