2011-12-19 68 views
2

我有一个与UIViewController有关的问题,请在您回答之前先阅读,它比看起来更复杂。无需更改超级UIViewController旋转工作没有问题!UISpliViewController DetailView旋转后消失

我在人像方向的UISplitViewController,比我克利克的按钮显示UIPopoverController Popover shown 现在我改变的UIViewController从UISplitViewC到UITableViewC tableview 现在我旋转的iPad为横向 tableview landscape 最后切换回SpliViewController! splitviewcontroller landscape 正如您所看到的,MasterViewController未显示,NavigationItem也不会消失。

这使我的假设是,SPLITVIEW的委托函数不叫上的UITableViewController(毫无疑问)的旋转

我该怎么处理这个问题?

授职能

- (void)splitViewController: (UISplitViewController*)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController: (UIPopoverController*)pc { 

//debug_NSLog(@"Entering portrait, showing the button: %@", [aViewController class]); 
     barButtonItem.title = @"Akten"; 
     [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES]; 
     [self setMasterPopover: pc]; 
} 


// Called when the view is shown again in the split view, invalidating the button and popover controller. 
- (void)splitViewController: (UISplitViewController*)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem { 

     //debug_NSLog(@"Entering landscape, hiding the button: %@", [aViewController class]); 
     [self.navigationItem setLeftBarButtonItem:nil animated:NO]; 
     [self setMasterPopover: nil]; 
    } 

感谢您的帮助!

+0

同样的问题在这里。如果你解决了,你可以发布你如何做?谢谢 – masgar 2013-05-16 20:41:22

回答

0

这是太久以前,但只要我记得它是这样的东西stackoverflow.com/questions/4649617/...
你主视图控制器需要实现接收splitview委托并将其转发到splitview甚至如果它不可见。

不能保证,就像我说的,很久以前

0

同样的问题在这里,但委托的功能肯定会被调用,你可以检查通过把NSLog 其他方式让你自己的popovercontroller &调用它在didrotate方法。