我的 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 具有圆角......我该怎么做?
最佳答案
使用NSView的layer属性,可以为其设置一个角半径。
关于objective-c - 绘制圆角 NSTextFieldCell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1938925/