Mac - 设置NSButton 的背景色

复制代码
- (void)drawRect:(NSRect)dirtyRect {
    [super drawRect:dirtyRect];
        [[NSColor clearColor] setFill];
     NSRectFill(self.bounds);


    self.wantsLayer = YES;
    self.layer.cornerRadius = 8;

    self.layer.masksToBounds = YES;
}
复制代码

 

posted @   Qingyun_Qearl  阅读(935)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示