iOS - 全屏播放时的Youtube播放器控制器栏颜色

时间:2013-05-26 10:40:39

标签: ios ios6 youtube

我在使用UIWebView的视图中嵌入了youtube。

NSString *html = [NSString stringWithFormat:@"<html> <body style=\"margin:0;\"><iframe class=\"youtube-player\" type=\"text/html\" width=\"%f\" height=\"%f\" src=\"http://www.youtube.com/embed/%@\" frameborder=\"0\" allowfullscreen></iframe></body></html>", self.view.bounds.size.width - kTitleLabelLeftIndent*2, kUIWebViewHeight, self.utubeId];

utubeWebView = [[UIWebView alloc]init];
[utubeWebView setAllowsInlineMediaPlayback:YES]; 
[utubeWebView loadHTMLString:html baseURL:nil];

youtube网址已完全嵌入我的应用中。当我点击utudeWebView上的播放按钮时,它会显示如下全屏:

enter image description here

顶部的红色控制器栏看起来不太好。有人可以告诉我如何更改该栏的颜色?

任何建议将不胜感激。提前谢谢,

约翰

1 个答案:

答案 0 :(得分:6)

我弄清楚为什么它现在变红了。

在我的AppDelegate中,我设置了NavigationBar的外观:

[[UINavigationBar appearance] setTintColor:[UIColor redColor]];

我没有注意到navigationBar和视频控制栏之间的关系,因为我的navigationBar设置已隐藏。

不知何故,navigationBar颜色的设置也会影响MPmoviePlayerController控件栏的颜色。因此,设置NavigationBar的Tint Color,我可以更改控制栏的颜色。以下是一些例子:

enter image description here

enter image description here

相关问题