I have UIView
with lots of subviews (UILabel, UITextView, etc.).
If a set alpha 0.6 to main view all the subviews takes this alpha.
How to set alpha separately of main view?
An object that manages the content for a rectangular area on the screen. Views are the fundamental building blocks of your app's user interface, and the UIView class defines the behaviors that are common to all views. A view object renders content within its bounds rectangle, and handles any interactions with that content.
Changing the value of this property updates the alpha value of the current view only. However, the transparency imparted by that alpha value affects all of the view's contents, including its subviews.
To animate your changes, create a UIViewPropertyAnimator object and use its handler block to change the values of your view's properties. The UIViewPropertyAnimator class lets you specify the duration and timing of your animations, but it performs the actual animations.
Because it waits until the next drawing cycle to update the view, you can call these methods on multiple views to update them at the same time. If you are using OpenGL ES to do your drawing, you should use the GLKView class instead of subclassing UIView.
[view setBackgroundColor:[[UIColor clearColor] colorWithAlphaComponent:0.5]];
//try this.. dont try to set alpha of UIView and also your subviews will not affect
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With