NSVisualEffectView with rounded corners
问题 How display a NSVisualEffectView with with rounded corners in OS X? My code to add my NSVisualEffectView: let visualEffectView = NSVisualEffectView(frame: NSMakeRect(0, 0, 300, 300)) visualEffectView.material = NSVisualEffectMaterial.Dark visualEffectView.blendingMode = NSVisualEffectBlendingMode.BehindWindow self.addSubview(visualEffectView) 回答1: You can enable layer backed views for your NSVisualEffectView by setting wantsLayer to true and then set the cornerRadius of the backing layer: let