// // ZGNetCircularProgressView.m // UUTUtils // // Created by zhuge on 2018/1/22. // Copyright © 2018年 zhuge. All rights reserved. // #import "ZGNetCircularProgressView.h" @implementation ZGNetCircularProgressView - (instancetype)init { self = [super init]; if (self) { } return self; } - (void)drawRect:(NSRect)dirtyRect { [super drawRect:dirtyRect]; // 设置背景为半透明 NSColor *bg = [NSColor colorWithSRGBRed:0 green:0 blue:0 alpha:0.8]; [bg setFill]; NSRectFill(dirtyRect); // 画文字 NSString *str = @"数据加载中。。。"; NSMutableDictionary *md = [NSMutableDictionary dictionaryWithCapacity:0]; md[NSFontAttributeName] = [NSFont fontWithName:@"Arial" size:50]; md[NSForegroundColorAttributeName] = [NSColor whiteColor]; [str drawAtPoint:NSMakePoint(50, 50) withAttributes:md]; } @end