mpmovieplayer没有在ios6中设置背景

时间:2013-12-23 14:04:24

标签: ios iphone objective-c mpmovieplayercontroller

此代码未在iOS6中设置MPMoviePlayerController的背景视图,但在iOS7中完美运行。

UIView *patternView = [[UIView alloc] initWithFrame:self.view.bounds];
patternView.backgroundColor = [UIColor redColor];
UIImageView *imgView=[[UIImageView alloc]initWithFrame:self.view.bounds];
imgView.image=imgBackGround;
[patternView addSubview:imgView];
[self.moviePlayer.backgroundView addSubview:patternView];

有什么替代方案?

1 个答案:

答案 0 :(得分:0)

您最终将背景颜色设置为红色。如果您只想设置背景颜色,则不要直接设置任何视图并添加它,而是直接设置其MPMoviePlayerController视图的背景颜色。

[self.moviePlayer.view setBackgroundColor:[UIColor redColor]];