无法让NSProgressIndicator具有清晰的背景,它以灰色背景显示:
let progressbar = NSProgressIndicator.init(frame: NSRect(x: 10, y: y+4, width: 60, height: 60))
progressbar.style = NSProgressIndicatorStyle.SpinningStyle
progressbar.controlTint = NSControlTint.ClearControlTint
progressbar.wantsLayer = true
progressbar.layer?.backgroundColor = NSColor.clearColor().CGColor
self.contentView.addSubview(progressbar)有什么想法吗?
发布于 2019-06-21 09:23:34
我知道这有点晚了3年,我知道你可能已经准备好了,但这就是答案。
progressbar.appearance = NSAppearance(named: NSAppearance.Name.aqua)发布于 2016-08-06 05:48:14
尝试将wantsLayer = true设置为窗口本身(也可能设置为内容视图)。
https://stackoverflow.com/questions/38797888
复制相似问题