iOS MPMoviePlayer - 模仿控件出现/消失的行为

时间:2013-08-02 21:44:57

标签: ios mpmovieplayercontroller mpmovieplayer movieplayer

我有一个按钮,我想显示和隐藏iOS MPMoviePlayer控件在点击视频时执行的操作。除了制作我自己的手势识别器和计时器以隐藏/显示苹果按钮时,还有更好的方法吗?

1 个答案:

答案 0 :(得分:1)

那将是你最好的选择。这大致是它的样子:

UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(videoTapped:)];
[videoView addGestureRecognizer:recognizer];

...

- (void)videoTapped:(UITapGestureRecognizer *)recognizer {
    [UIView animateWithDuration:0.25f animations:^{
        buttonView.alpha = (CGFloat)!buttonView.alpha;
    }];
}

如果您有任何其他问题,请告诉我。