Fading out MPMoviePlayerController controls

送分小仙女□ 提交于 2019-12-24 09:58:23

问题


When I start a movie in a MPMoviePlayerController, controls stay at the top for few seconds. After that, they fade out.

I want simulate this effect when I use MPMovieControlStyleNone in controlStyle property, but controls disappear abruptly. I tried to use animations without success with the following code:

        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:0.50f];
        self.myMoviePlayer.controlStyle = MPMovieControlStyleNone;
        [UIView commitAnimations];

Someone have any idea how I can make that?

Any help will be appreciated.

Thanks.


回答1:


If I understand you correctly, you are planning to hide custom controls in a similar fashion to the original controls.

You will need hide your custom controls using something like

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.50];
self.customControlsView.alpha = 0.0f;
[UIView commitAnimations];

to achieve that effect. controlStyle is not an animatable property.

On tops, you will need to stick to controlStyle = MPMovieControlStyleNone anyways throughout the lifetime of your MPMoviePlayerController as that is the only way to prevent the original controls from appearing.



来源:https://stackoverflow.com/questions/5984478/fading-out-mpmovieplayercontroller-controls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!