Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide master view in UiSplitviewcontroller in ipad

Is there is any way to hide the master view in a splitviewcontroller programmatically. In my application the first screen will be of a splitviewcontroller, i don't need any split view for the next screens. How i can achieve this

like image 341
i0707 Avatar asked Apr 23 '10 16:04

i0707


2 Answers

in SDK 5.0 they added new method for UISplitViewControllerDelegate that would do this easily for you. Just implement it like next and you would not see the master view:

- (BOOL)splitViewController:(UISplitViewController*)svc     shouldHideViewController:(UIViewController *)vc                inOrientation:(UIInterfaceOrientation)orientation  {     return YES; } 

The only place when you can see it is rotation - the part of master view is visible during animation. I've fixed that in simple way, just loaded empty and black view in master.

PS: not sure whether this is actual for i0707. But hope this could be useful for other people that now have the same issues.

like image 147
Anton Avatar answered Sep 28 '22 18:09

Anton


Same as answer from Jack but a one liner. Past into - (void)setDetailItem:(id)newDetailItem { ... } to dismiss the master.

[[UIApplication sharedApplication] sendAction: self.navigationItem.leftBarButtonItem.action                                            to: self.navigationItem.leftBarButtonItem.target                                          from: nil                                      forEvent: nil]; 
like image 40
pizzamonster Avatar answered Sep 28 '22 17:09

pizzamonster