創建新風格外觀的OSX應用:Modern Look OSX
這個項目的目的是提供一組簡單和可定制的組件集。可用于創建新風格外觀的OSX應用。
Here is the code of the MLTextField class.
- (void) commonInit { self.font = [NSFont fontWithName:@"Helvetica Neue Light" size:16.0]; self.bordered = false; self.backgroundColor = [NSColor clearColor]; self.focusRingType = NSFocusRingTypeNone; } - (void)drawRect:(NSRect)dirtyRect { [NSGraphicsContext saveGraphicsState]; NSRect bounds = [self bounds]; [[NSColor blackColor] set]; NSBezierPath *bottomLine = [NSBezierPath bezierPath]; NSPoint p = NSZeroPoint;//bounds.origin; p.y = bounds.size.height; [bottomLine moveToPoint:p]; p.x += bounds.size.width; [bottomLine lineToPoint:p]; [bottomLine stroke]; [NSGraphicsContext restoreGraphicsState]; [super drawRect:dirtyRect]; }
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!