I have a Custom UIViewController named A and i want to add its view to another controllers (named B) view as subview. A's view contain two buttons as subviews. I want to make A's view transparent but the buttons in it nontransparent. I want to know is there any way to do it?
As of I noticed,
If a view is set a opacity/alpha value, all its subviews will be applied with that opacity/alpha value.
Try setting the views background color to [UIColor clearColor]
viewA.backgroundColor = [UIColor clearColor];
[viewA addSubview:button1];
[viewA addSubview:button2];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.