Dibujo de un NSTextFieldCell redondeado arrinconado
-
20-09-2019 - |
Pregunta
Mi código para mi NSTextFieldCell es:
- (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];
}
Me gustaría tener la NSTextFieldCell tener esquinas redondeadas .... ¿cómo podría hacerlo?
Solución
Utilice la propiedad de capa de NSView, entonces se puede establecer un radio de esquina para ello.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow