comment faire pivoter une NSCell
-
26-09-2019 - |
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];}
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