简体   繁体   中英

UIView Animation of MPMoviePlayerController view

I have a movie playing successfully in a container view that is managed by

BWCVideoViewController : UIViewController

When I start the movie (which works fine), I fade the movie view in successfully using the following

[self.view addSubview:theMovie.view];
theMovie.view.alpha = 0.0;
[theMovie play];
[self movieFadeIn];


- (void)movieFadeIn
{

    [UIView animateWithDuration:3.0
                          delay:0.0
                        options:UIViewAnimationOptionCurveLinear
                     animations:^{
                         theMovie.view.alpha = 1.0f;
                     }
                    completion:nil];

}

But for the life of me I cannot fade the movie view out when the movie is either stopped or still playing! It just "flashes" and disappears abruptly:

- (void)movieFadeOut
{

    [UIView animateWithDuration:2.5
                          delay:0.0
                        options:UIViewAnimationOptionCurveLinear
                     animations:^{
                         theMovie.view.alpha = 0.1f;
                     }
                     completion:nil];
}

I've followed suggestions elsewhere on SO such as here but I'm baffled. Same result in simulator/device (iOS7)

Well I've solved it, but not how I expected to. I created another subview (so it sits ABOVE the video) with the same frame size. I fade this out/in and get the desired result. weird.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM