Question

Je fais une sous-classe de la NSLevelIndicatorCell et je veux dessiner verticalement. Cela ne fonctionne pas, ce que je fais 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];}
Était-ce utile?

La solution

[self setBoundsRotation:90];

[self setNeedsDisplay];

Maintenant, je juste besoin de savoir comment obtenir les bords redimensionnables au changement de l'horizontale à la verticale ...

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top