ios - 如何在 AVPlayerViewController 中添加完成按钮?
<p><p>我正在使用 <strong>AVPlayerViewController</strong> 并且无法显示 <strong>Done</strong> 按钮,也无法关闭播放器。也许你可以帮助我。这是我在 objective-c 中的代码</p>
<pre><code>UIView *view = self.view;
NSURL *fileURL = ];
AVPlayerViewController *playerViewController = [ init];
playerViewController.player = ;
self.avPlayerViewcontroller = playerViewController;
;
;
;
;
view.autoresizesSubviews = TRUE;
</code></pre>
<p>需要帮助的人,非常感谢。</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><pre><code>UIButton *button = ;
[button addTarget:self
action:@selector(aMethod:)
forControlEvents:UIControlEventTouchUpInside];
;
button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0); // set your own position
; // or you can add ;
-(void)aMethod:(UIButton *)button {
// Remove playerViewController.view
}
</code></pre></p>
<p style="font-size: 20px;">关于ios - 如何在 AVPlayerViewController 中添加完成按钮?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/36175842/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/36175842/
</a>
</p>
页:
[1]