cocoa自定义button样式
图片素材
素材图片来自http://dribbble.com/shots/280227-Free-PSD-I-m-Ready-to-Dribbble
实战
预览
项目结构
button属性
更改窗体的背景颜色
- (void)drawRect:(NSRect)dirtyRect {
[[NSColor colorWithCalibratedRed:0.26f green:0.29f blue:0.31f alpha:1.0f] set];
NSRect rect = NSMakeRect(0.0, 0.0, self.bounds.size.width, self.bounds.size.height);
NSRectFill(rect);
}
源码:cusbtn.zip
简洁风,我喜欢