How to add a blurred view ontop of a view?

后端 未结 4 1327
灰色年华
灰色年华 2021-01-30 09:54

I have an NSTableView that gets reloaded. While new data is loading, I want to add a subview ontop of it with a spinner. I would like the view ontop to be semi-transparent and r

4条回答
  •  天命终不由人
    2021-01-30 10:11

    The basic technique would be to snap an image of your view, using something like the ‑bitmapImageRepForCachingDisplayInRect: method of NSView, processing that image to make it blurred (Core Image is your friend here) and then overlay your view with an NSImageView containing the blurred image.

    This is fakery, of course, but that's what showmanship is about :-)

提交回复
热议问题