How to correctly set alpha of UIView?

2 Solutions Collect From Internet About “How to correctly set alpha of UIView?”

 [view setBackgroundColor:[[UIColor clearColor] colorWithAlphaComponent:0.5]];

 //try this.. dont try to set alpha of UIView and also your subviews will not affect
myView.layer.shouldRasterize = YES

This will make it use group opacity and everything should composite as you’d expect.