Pregunta

Estoy haciendo una subclase de la NSLevelIndicatorCell y quiero llamar de forma vertical. Esto no funciona, ¿qué estoy haciendo mal?

- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView{
[[NSGraphicsContext currentContext] saveGraphicsState];
NSAffineTransform *transform = [NSAffineTransform transform];
[transform rotateByDegrees:90];
[transform concat];
[super drawWithFrame:cellFrame inView:controlView];
[[NSGraphicsContext currentContext] restoreGraphicsState];}
¿Fue útil?

Solución

[self setBoundsRotation:90];

[self setNeedsDisplay];

Ahora, sólo tiene que encontrar la manera de llegar a los bordes de tamaño variable a cambio de horizontal a vertical ...

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top