首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将导航栏添加到MoviePlayer

将导航栏添加到MoviePlayer
EN

Stack Overflow用户
提问于 2013-01-20 15:47:58
回答 1查看 165关注 0票数 0

就播放视频而言,我想知道我能用iPad做些什么。我有以下UIButton操作的代码。

代码语言:javascript
复制
- (IBAction)playClick:(id)sender {
NSBundle *bundle = [NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"video3" ofType:@"m4v"];
NSURL  *movieURL = [NSURL fileURLWithPath:moviePath];
MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
theMovie.scalingMode = MPMovieScalingModeAspectFill;
[theMovie play];
MPMoviePlayerViewController *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL];
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
}

如上所示,我得到了一个电影屏幕。我想知道是否有可能在电影屏幕的顶部(‘完成’上方)或底部(控制器下方)包含一个导航栏,以便在用户播放视频时添加一些操作?我猜this topic可能会关心我想做什么。

谢谢你的帮助。

EN

回答 1

Stack Overflow用户

发布于 2013-01-20 18:35:09

可以使用以下命令添加更多按钮:

代码语言:javascript
复制
UIBarButtonItem *button = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(yourButtonAction:)]; 
moviePlayer.navigationItem.rightBarButtonItem = button; 

根据需要自定义这些按钮。

尝试这个有意义的.Hope。

问候

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14422646

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档