我有包含视频列表的主视图.选择任何列表项时,它会在详细视图上开始播放该项目的视频.
我正在使用MPMovIEPlayerController播放视频.
如果我按全屏图标,播放器应该填满整个屏幕(主视图和详细视图,而不仅仅是详细视图).
我怎么能这样做?请帮忙!解决方法 您可以使用UISplitVIEwController的Delegate隐藏或显示MasterVIEwcontroller
- (BOol)splitVIEwController:(UISplitVIEwController *)svc shouldHIDeVIEwController:(UIVIEwController *)vc inorIEntation:(UIInterfaceOrIEntation)orIEntation- (voID)splitVIEwController:(UISplitVIEwController *)svc willShowVIEwController:(UIVIEwController *)aVIEwController invalIDatingbarbuttonItem:(UIbarbuttonItem *)barbuttonItem;- (voID)splitVIEwController:(UISplitVIEwController *)svc willHIDeVIEwController:(UIVIEwController *)aVIEwController withbarbuttonItem:(UIbarbuttonItem *)barbuttonItem forPopoverController:(UIPopoverController *)pc;
更新: –
示例代码: –
在DetailVIEwController.h类中设置一个BOol值
@interface DetailVIEwController : UIVIEwController <UISplitVIEwControllerDelegate>@property (nonatomic) BOol IShIDe;
并按照方法执行此 *** 作.M类
-(voID)hIDeMaster:(ID)hIDeState{ _IShIDe=!self.IShIDe; [self.splitVIEwController.vIEw setNeedsLayout]; self.splitVIEwController.delegate = nil; self.splitVIEwController.delegate = self; [self.splitVIEwController willRotatetoInterfaceOrIEntation:[UIApplication sharedApplication].statusbarOrIEntation duration:0]; //also put your `MPMovIEPlayerController` Fullscreen Method here}#pragma mark - Split vIEw-(BOol)splitVIEwController:(UISplitVIEwController *)svc shouldHIDeVIEwController:(UIVIEwController *)vc inorIEntation:(UIInterfaceOrIEntation)orIEntation{ return self.IShIDe;}- (voID)vIEwDIDLoad{ UIbarbuttonItem *Fullscreen = [[UIbarbuttonItem alloc] initWithTitle:NSLocalizedString(@"FullScreen",nil) style:UIbarbuttonItemStylePlain target:self action:@selector(hIDeMaster:)]; [self.navigationItem setRightbarbuttonItem:Fullscreen animated:YES]; [super vIEwDIDLoad];}
当你单击你的全屏事件时,MPMovIEPlayerController会将此委托与此事件一起调用,隐藏并显示MasterVIEwController.
代码输出是
总结以上是内存溢出为你收集整理的ios – 在iPad的全屏模式下填写主视图和详细视图全部内容,希望文章能够帮你解决ios – 在iPad的全屏模式下填写主视图和详细视图所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)