我想要一个圆角的窗户.但是我在每个角落都有一个白点. 码: let effect = NSVisualEffectView(frame: NSRect(x: 0, y: 0, width: 0, height: 0))effect.blendingMode = .behindWindoweffect.state = .activeeffect.material = .dar
码:
let effect = NSVisualEffectView(frame: NSRect(x: 0, y: 0, width: 0, height: 0)) effect.blendingMode = .behindWindow effect.state = .active effect.material = .dark effect.wantsLayer = true effect.layer?.cornerRadius = 15.0 window.contentView = effect window.titlebarAppearsTransparent = true window.titleVisibility = .hidden
输出:
如何摆脱角落里的那些白点?
还要将此代码添加到您的代码中window.isOpaque = false window.backgroundColor = .clear
我没有我的机器检查,但一旦我有同样的问题,我想我通过使用上面的代码解决它.当我回到我的机器时,我会检查.
试一试并更新我.