ZGNetCircularProgressView.m 895 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // ZGNetCircularProgressView.m
  3. // UUTUtils
  4. //
  5. // Created by zhuge on 2018/1/22.
  6. // Copyright © 2018年 zhuge. All rights reserved.
  7. //
  8. #import "ZGNetCircularProgressView.h"
  9. @implementation ZGNetCircularProgressView
  10. - (instancetype)init
  11. {
  12. self = [super init];
  13. if (self) {
  14. }
  15. return self;
  16. }
  17. - (void)drawRect:(NSRect)dirtyRect {
  18. [super drawRect:dirtyRect];
  19. // 设置背景为半透明
  20. NSColor *bg = [NSColor colorWithSRGBRed:0 green:0 blue:0 alpha:0.8];
  21. [bg setFill];
  22. NSRectFill(dirtyRect);
  23. // 画文字
  24. NSString *str = @"数据加载中。。。";
  25. NSMutableDictionary *md = [NSMutableDictionary dictionaryWithCapacity:0];
  26. md[NSFontAttributeName] = [NSFont fontWithName:@"Arial" size:50];
  27. md[NSForegroundColorAttributeName] = [NSColor whiteColor];
  28. [str drawAtPoint:NSMakePoint(50, 50) withAttributes:md];
  29. }
  30. @end