开发者

NSTableView rounded corners

开发者 https://www.devze.com 2023-02-06 15:42 出处:网络
For drawing rounded corners in the NSTableV开发者_如何学Ciew subclass I override the drawRect method

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消