如何在NSTextField
我添加了一个NSVisualEffectView
带有界面构建器并尝试使用NSAppearance
为标签添加活力的情况下实现活力效果
var varLabel = NSTextField()
varLabel.stringValue = "Some"
varLabel.appearance = NSAppearance(named: .vibrantLight)
如何在NSTextField
我添加了一个NSVisualEffectView
带有界面构建器并尝试使用NSAppearance
为标签添加活力的情况下实现活力效果
var varLabel = NSTextField()
varLabel.stringValue = "Some"
varLabel.appearance = NSAppearance(named: .vibrantLight)
allowsVibrancy
。@interface VibrancyTextField : NSTextField
@end
@implementation VibrancyTextField
- (BOOL)allowsVibrancy {
return YES;
}
@end
class VibrancyTextField: NSTextField {
override var allowsVibrancy {
return true
}
}
VibrancyTextField *testField = [VibrancyTextField new];
testField.stringValue = @"Hello ████████████████████";
testField.textColor = NSColor.systemGrayColor;
[testField release];
let testField = VibrancyTextField()
testField.stringValue = "Hello ████████████████████"
testField.textColor = .systemGrayColor