gpt4 book ai didi

objective-c - MPMoviePlayerController 覆盖 iOS 6

转载 作者:太空狗 更新时间:2023-10-30 03:53:22 24 4
gpt4 key购买 nike

在 iOS6 中使用覆盖层的 MPMoviePLayerController 有问题,在 iOS6 之前一切正常。

在我有这段代码之前,我似乎可以全屏播放电影:

@interface MovieOverlayViewController : UIViewController
{
UIImageView *skiparrow;
}
@end


@implementation MovieOverlayViewController

-(void) viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];

touchtoskip.frame = CGRectMake( xAdjust,
yAdjust,
touchtoskip.image.size.width / scale,
touchtoskip.image.size.height / scale);



[self.view addSubview:touchtoskip];
}

然后:

overlay = [[MovieOverlayViewController alloc] init];

UIWindow *keyWnd = [[UIApplication sharedApplication] keyWindow];
[keyWnd addSubview:overlay.view];

在我的 MoviePlayerViewController 上, View 确实出现了。并添加了 UIView,但我什么也看不到了。

真的卡住了,有什么建议吗?

最佳答案

我认为部分问题在于您正在获取关键窗口并向其添加 subview ,而不是获取窗口的 View 并向其添加 subview 。

看看 MoviePlayer示例,展示了如何添加带有 subview 的播放器来控制播放。

关于objective-c - MPMoviePlayerController 覆盖 iOS 6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12686972/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com