Question

I have a background image set like this:

[self.window setBackgroundColor:[NSColor colorWithPatternImage:[NSImage imageNamed:@"Background"]]];

Also I got IKImageBrowserView which color is set to alpha like this:

 [_imageBrowser setValue:[NSColor colorWithCalibratedWhite:0.0 alpha:0.0] forKey:IKImageBrowserBackgroundColorKey];

The problem is, when I resize the window, the image in the background behind the IKImageBrowser gets drawn properly, but window background, does not. It looks like it does not move at all while the window gets resized.  Like on the very right of the image it was redrawn ok, but on the bottom left you can see the problem.

Has anyone encountered something like this?

Was it helpful?

Solution

Try this:

[[window contentView] setWantsLayer:YES];
[[window contentView] layer].contents = [NSImage imageNamed:@"backgroung image"];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top