For drawing rounded corners in the NSTableV开发者_如何学Ciew subclass I override the drawRect method
- (void)drawRect:(NSRect)rect{
NSBezierPath* path = [NSBezierPath bezierPathWithRoundedRect:rect cornerRadius:7.0f];
[path addClip];
[super drawRect:selfRect];
}
This works as long as the content of the table view is not too big and not showing the scrollers. But when the content gets bigger, the scrollers of the NSScrollView are displayed and the rounded edges disappear.
Any hints for this?
Since a table view is contained in a scroll view, I guess what you want is a scroll view but not table view with rounded corners. Maybe you can try to subclass the scroll view.
精彩评论