我使用MPMovIEPlayerController,但这显示黑色背景.
我认为这个问题可以通过这个URL解决,但我无法理解使用方式.
MPMoviePlayerController background color won’t stick
我的代码是这样的.
Nsstring *path = [[NSBundle mainBundle] pathForResource:@"movIE_files" ofType:@"m4v"];NSURL *vIDeoURL = [NSURL fileURLWithPath:path];movIEPlayer = [[MPMovIEPlayerController alloc] initWithContentURL:vIDeoURL];//settingmovIEPlayer.scalingMode =MPMovIEScalingModeAspectFit;movIEPlayer.controlStyle=MPMovIEControlStyleDefault;movIEPlayer.shouldAutoplay=NO;[movIEPlayer.vIEw setFrame:CGRectMake(20,20,280,200)]; //notification[[NSNotificationCenter defaultCenter] addobserver:self selector:@selector(movIEPlayBackDIDFinish:) name:MPMovIEPlayerPlaybackDIDFinishNotification object:movIEPlayer];//clearcolorUIVIEw *subV =[[UIVIEw alloc]init];for(subV in movIEPlayer.backgroundVIEw.subvIEws) { subV.backgroundcolor = [UIcolor clearcolor];}[movIEPlayer.vIEw addSubvIEw:subV]; [self.vIEw addSubvIEw:movIEPlayer.vIEw];//show white screen
请告诉清楚的背景方式.
解决方法 您需要将其更改为:movIEPlayer.backgroundVIEw.backgroundcolor = [UIcolor clearcolor];for(UIVIEw *aSubVIEw in movIEPlayer.vIEw.subvIEws) { aSubVIEw.backgroundcolor = [UIcolor clearcolor];}总结
以上是内存溢出为你收集整理的iphone – MPMoviePlayerController存在黑色背景全部内容,希望文章能够帮你解决iphone – MPMoviePlayerController存在黑色背景所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)