OGeek|极客世界-中国程序员成长平台

标题: iOS MPMoviePlayer - 模仿控件出现/消失的行为 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 13:15
标题: iOS MPMoviePlayer - 模仿控件出现/消失的行为

我有一个按钮,当点击视频时,我想像 iOS MPMoviePlayer 控件一样显示和隐藏它。除了制作我自己的手势识别器和计时器来在苹果的时候隐藏/显示按钮之外,还有更好的方法吗?



Best Answer-推荐答案


那将是您的最佳选择。大致如下:

UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self actionselector(videoTapped];
[videoView addGestureRecognizer:recognizer];

...

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

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

关于iOS MPMoviePlayer - 模仿控件出现/消失的行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18026582/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4