我正在创建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];}
答案 0 :(得分:0)
[self setBoundsRotation:90];
[self setNeedsDisplay];
现在,我只需要弄清楚如何让可调整大小的边从水平变为垂直......