MPMoviePlayerController背景颜色不会粘 [英] MPMoviePlayerController background color won't stick

查看:102
本文介绍了MPMoviePlayerController背景颜色不会粘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试更改我的MPMoviePlayerController的背景颜色,我无法坚持下去。

I'm trying to change the background color of my MPMoviePlayerController, and I can't get it to stick.

我正在使用:

moviePlayer.view.backgroundColor = [UIColor redColor];

视频加载时,我可以看到背景闪烁红色。加载后,背景再次变黑。我已经尝试在播放开始后设置颜色,但这没有效果。

I can see the background flash red while the video is loading. As soon as it is loaded, the background goes black again. I've tried setting the color after playback has started, but that has no effect.

我正在使用iOS 5.

I'm using iOS 5.

编辑:我实际上是在尝试将背景设置为[UIColor clearColor],而不是红色。我应该首先正确地提出我的问题。

I'm actually attempting to set the background to [UIColor clearColor], not red. I should have asked my question properly in the first place.

推荐答案

backgroundColor on 不推荐使用MPMoviePlayerController ,并将 view 记录为只读。请参阅:不推荐使用MPMoviePlayerController方法

backgroundColor on MPMoviePlayerController is deprecated and view is documented as read-only. See: Deprecated MPMoviePlayerController Methods


backgroundColor
电影背后区域的颜色。 (适用于iOS 2.0至iOS 3.1。从
backgroundView 属性中获取视图并直接设置其颜色。)

backgroundColor
The color of the background area behind the movie. (Available in iOS 2.0 through iOS 3.1. Get the view from the backgroundView property and set its color directly.)

@属性(非原子,保留)UIColor * backgroundColor

@property (nonatomic, retain) UIColor *backgroundColor

所以我会尝试使用:

moviePlayer.backgroundView.backgroundColor = [UIColor redColor];

这篇关于MPMoviePlayerController背景颜色不会粘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆