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 @ 2016-01-25 11:48  Qingyun_Qearl  阅读(932)  评论(0编辑  收藏  举报