2010-09-02 85 views
0

我正在做一个NSLevelIndicatorCell的子类,我想垂直绘制它。这不起作用,我做错了什么?现在如何旋转nscell

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

你是什么意思是“这行不通”吗? – 2010-09-02 16:21:10

+0

它正在绘制指标超出界限。有没有办法转动整个控制器,而不是画出旋转的单元格? – joels 2010-09-02 17:37:48

回答

0
[self setBoundsRotation:90]; 

[self setNeedsDisplay]; 

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