Search code examples
macosnsviewnscolor

How to get a white half transparent NSView


The result I want is:

enter image description here

I tried to set the background color of that "white transparent view" to white with a alpha about 0.5f. But the result I got is:

enter image description here

Can somebody tell me how to do it?


Solution

  • After several days of research I figure it out that development in Mac OS is different from iOS. That is I can't accomplish this by using a semitransparent view. I need to use a whole background image. And I can what I want by doing it on the image I use! It's indeed a little to me.