Frage

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 ?

War es hilfreich?

Lösung

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

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top