MPMoviePlayerViewController,删除quicktime符号/添加背景图像? [英] MPMoviePlayerViewController, remove quicktime symbol/add background image?

查看:131
本文介绍了MPMoviePlayerViewController,删除quicktime符号/添加背景图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个播放音频的MPMoviePlayerViewController。我想删除Quicktime徽标和/或向播放器添加自定义背景图像,但保留播放控件。我发誓我已经在iOS 5之前完成了这个,但我无法重新弄明白!我尝试过的事情:

I have an MPMoviePlayerViewController that plays audio. I would like to remove the Quicktime logo and/or add a custom background image to the player but keep the playback controls. I swear I have done this before prior to iOS 5 but I can't re-figure it out! Things I have tried:

- 将子视图添加到MPMoviePlayerViewController。将子视图放在播放控件上,不是很好。

-Adding a subview to MPMoviePlayerViewController. Puts the subview OVER the playback controls, not good.

带有patternimage的moviePlayer的-setBackgroundColor。什么都不做。

-setBackgroundColor of the moviePlayer with a patternimage. Doesn't do anything.

整个MPMoviePlayerViewController上的-setView。正如预期的那样,播放控件和导航栏都消失了。我想这可行,但我需要手动重新创建所有播放控件,但我真的不愿意。

-setView on the entire MPMoviePlayerViewController. As expected, the playback controls and navigation bar are gone. I suppose this could work but I'd need to recreate all the playback controls manually, but I'd really rather not.

任何人都可以解决这些问题吗?

Can anyone shed some light?

推荐答案

查看 MPMoviePlayerController 属性 backgroundView

来自 MPMoviePlayerController类参考;


backgroundView

backgroundView

电影
内容后面显示的可自定义视图。 (只读)

A customizable view that is displayed behind the movie content. (read-only)

@property(非原子,只读)UIView * backgroundView

@property (nonatomic, readonly) UIView *backgroundView

讨论这个
视图提供支持内容,在其上显示电影内容
。如果希望
显示自定义背景内容,可以将子视图添加到背景视图。

Discussion This view provides the backing content, on top of which the movie content is displayed. You can add subviews to the background view if you want to display custom background content.

此视图是view属性返回的视图层次结构的一部分。

This view is part of the view hierarchy returned by the view property.

可用性适用于iOS 3.2及更高版本。声明在
MPMoviePlayerController.h

Availability Available in iOS 3.2 and later. Declared In MPMoviePlayerController.h

尝试这样的事情(假设您的MPMoviePlayerController实例被称为 moviePlayerController ):

Try something like this (assuming that your instance of the MPMoviePlayerController is called moviePlayerController):

patternView = [[UIView alloc] initWithFrame:self.view.bounds];
patternView.backgroundColor = [UIColor redColor];
[moviePlayerController.backgroundView addSubview:patternView];
[patternView release];

这篇关于MPMoviePlayerViewController,删除quicktime符号/添加背景图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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