Fill master and detail view in full screen mode of iPad

好久不见. 提交于 2019-12-30 01:38:13

问题


I am using Master-Detail Application template, in my iPad application.
I have master-view that contains list of videos. When selecting any list item, it starts playing video of that item on the detail-view.
I am using MPMoviePlayerController to play the videos.
If I press full screen icon, the player should fill the entire screen (master-view as well as detail-view, not just detail-view).
How could I do this? Please help!


回答1:


you can Hide or show MasterViewcontroller By using Delegate of UISplitViewController

- (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;

UPDATE:-

Example Code:-

set One BOOL value in you DetailViewController.h class

@interface DetailViewController : UIViewController <UISplitViewControllerDelegate>

@property (nonatomic) BOOL  IShide;

and Do this Following Method into you .M class

-(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];

}

while you click on the Fullscreen Event of you MPMoviePlayerController call this Delegate with this Event as par you hide and show MasterViewController.

Code OUTPUT is



来源:https://stackoverflow.com/questions/18208410/fill-master-and-detail-view-in-full-screen-mode-of-ipad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!