简体   繁体   English

当按下下一个/上一个按钮时,视图消失

[英]View disappearing when next/previous button is pressed

I have this very strange problem. 我有这个非常奇怪的问题。 I create an MPMoviePlayerController in my view controller with the following code: 我使用以下代码在视图控制器中创建一个MPMoviePlayerController

player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"vid96" ofType:@"mov"]]];
player.fullscreen = YES;
player.controlStyle = MPMovieControlStyleFullscreen;
player.view.frame = CGRectMake(0, 0, 320, 480); 
[self.view addSubview:player.view];

Now if the user taps on the next/previous buttons, the MPMoviePlayerController 's view simply disappears. 现在,如果用户点击上一个/下一个按钮,则MPMoviePlayerController的视图将消失。 Is this the normal behavior of MPMoviePlayerController ? 这是MPMoviePlayerController的正常行为吗? Is there a way to stop this? 有办法阻止这种情况吗? I don't really need the next/previous buttons, so if there's a way to disable or hide them that would be OK too. 我真的不需要下一个/上一个按钮,所以如果有一种禁用或隐藏它们的方法也可以。

try 尝试

[player setControlStyle:MPMovieControlModeHidden]; [player setControlStyle:MPMovieControlModeHidden];

I had a similar issue. 我有一个类似的问题。 It turns out that there was another UIView in the hierarchy above the MPMoviePlayerViewController.view. 事实证明,在MPMoviePlayerViewController.view上方的层次结构中还有另一个UIView。

Fixed that and the video stopped disappearing. 修复了该问题,视频停止消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM