Do a fadeout of one view that is below another?

0

I have a program that when a button is pressed, a view appears superimposed on the main one. I would like the view below to darken slightly (fadeout) so that the view that appears superimposed more contrast. I can not do it well because the code I have obscures both views.

[UIView animateWithDuration: 2.0
                 delay: 0.5 
                options: UIViewAnimationOptionCurveEaseOut 
             animations: ^{ 
                self.view.alpha = 0.5;
             } 
             completion: ^(BOOL finished) {
             }];
    
asked by Popularfan 17.01.2017 в 11:07
source

1 answer

1

Tests with the following:

[UIView animateWithDuration: 2.0
                 delay: 0.5 
                options: UIViewAnimationOptionCurveEaseOut 
             animations: ^{ 
                self.superview.alpha = 0.5;
             } 
             completion: ^(BOOL finished) {
             }];
    
answered by 17.01.2017 / 11:51
source