NSTableView rounded corners

瘦欲@ 提交于 2020-01-06 08:41:43

问题


For drawing rounded corners in the NSTableView 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?


回答1:


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.



来源:https://stackoverflow.com/questions/4803973/nstableview-rounded-corners

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!