我的NSTextFieldCell代码是:
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
// Drawing code here.
NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:[NSColor lightGrayColor] endingColor:[NSColor grayColor]];
[gradient drawInRect:cellFrame angle:90];
[[self title] drawInRect:cellFrame withAttributes:nil];
}我希望NSTextFieldCell有圆角……我怎么能这样做呢?
发布于 2009-12-21 22:05:25
使用NSView的layer属性,然后可以为其设置拐角半径。
https://stackoverflow.com/questions/1938925
复制相似问题