1
我的代碼爲我NSTextFieldCell是:繪製一個圓角走投無路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有圓角....我怎麼能做到這一點?
我該如何設置拐角半徑? – nanochrome 2009-12-21 20:57:15
controlView.layer.cornerRadius = 0.5; – Jac 2009-12-22 10:30:14