我提出了NSLevelIndicatorCell的子类,我想垂直绘制。这不工作,我究竟做错了什么?

- (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];

现在,我只需要弄清楚如何从水平得到可调整大小的边缘变垂直...

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top