كيفية تدوير 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