如何旋转的的NSCell
-
26-09-2019 - |
题
我提出了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];
现在,我只需要弄清楚如何从水平得到可调整大小的边缘变垂直...
不隶属于 StackOverflow