I'm on OSX, XCode 8.2, Objective-C
I have a window with a background Image:
self.window.titleVisibility = NSWindowTitleHidden;
self.window.titlebarAppearsTransparent = YES;
self.window.styleMask |= NSFullSizeContentViewWindowMask;
self.window.movableByWindowBackground = YES;
self.window.opaque = NO;
self.window.backgroundColor = [NSColor colorWithPatternImage:[NSImage imageNamed:@"background.jpg"]]];
In that window i have an NSTabViewController
. On one of those NSTabViews
i draw an NSView
with rounded corners:
- (id)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.layer = _layer; // strangely necessary
self.wantsLayer = YES;
self.layer.masksToBounds = YES;
self.layer.cornerRadius = 10.0;
}
return self;
}
My Problem is that even if the corners are round, there's still that bright white corner visible.
The answer here (rounded corners on NSView using NSBezierPath are drawn badly) didn't work for me because i have a background image - although it works WITHOUT background image. But i'd like to keep that image because the window is then draggable by clicking its background.
I also tried to use an NSImageView
for my background image, move it to the back and override it's mouseDownCanMoveWindow
method. That works too for the dragging, but still not for the corner drawing.
Any help appreciated