macos label没了,用NSTextField
2019-10-25 本文已影响0人
皮蛋豆腐酱油
NSTextField *label = [[NSTextField alloc] initWithFrame:self.win.contentView.frame];
label.backgroundColor = [NSColor clearColor];
label.selectable = FALSE;
label.bordered = FALSE;
label.editable = FALSE;
label.alignment = NSTextAlignmentCenter;
label.font = [NSFont systemFontOfSize:15];
label.stringValue = @"label";
[self.win.contentView addSubview:label];