문제

I am making a subclass of the NSLevelIndicatorCell and I want to draw it vertically. This doesn't work, what am I doing wrong?

- (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];}
도움이 되었습니까?

해결책

[self setBoundsRotation:90];

[self setNeedsDisplay];

Now, I just need to figure out how to get the resizable edges to change from horizontal to vertical...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top