I am trying to make a NSScrollView with clipped corners, similar to the Twitter app:
I have a NSScrollView
subclass which I added the following code:
- (void)drawRect:(NSRect)dirtyRect {
NSBezierPath *pcath = [NSBezierPath bezierPathWithRoundedRect:[self bounds] xRadius:kDefaultCornerRadius yRadius:kDefaultCornerRadius];
[path setClip];
[super drawRect:dirtyRect];
}
I expected the content of the NSScrollView
to have rounded corners, but it is not respecting the clipped path. How can I do this?
UPDATE & CLARIFICATION
I know how to make a custom NSScroller
, I know how to make it transparent overlay. All I am asking is how to make the NSSCrollView
clip its corners, including everything it contains. The NSScrollView
is inside a NSView
which has a background that could change, meaning a view overlay to fake the rounded corners is not an option.