菜鸟教程小白 发表于 2022-12-12 13:15:42

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


                                            <p><p>我有一个按钮,当点击视频时,我想像 iOS MPMoviePlayer 控件一样显示和隐藏它。除了制作我自己的手势识别器和计时器来在苹果的时候隐藏/显示按钮之外,还有更好的方法吗?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>那将是您的最佳选择。大致如下:</p>

<pre><code>UITapGestureRecognizer *recognizer = [ initWithTarget:self action:@selector(videoTapped:)];
;

...

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

<p>如果您有任何其他问题,请告诉我。</p></p>
                                   
                                                <p style="font-size: 20px;">关于iOS MPMoviePlayer - 模仿控件出现/消失的行为,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/18026582/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/18026582/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: iOS MPMoviePlayer - 模仿控件出现/消失的行为