Reputation: 501
I want a window with a rounded corners. But I get a white spot in every corner.
Code:
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
Output:
How to get rid of those white spot in the corners?
Upvotes: 8
Views: 3211
Reputation: 2523
Also add this code to your code
window.isOpaque = false
window.backgroundColor = .clear
I don't have my machine to check but once I had the same issue and I think I resolved it by using above code. I will check when I get back to my machine.
Give it a shot and update me.
Upvotes: 10