滑动手势很酷,可以纵向显示主视图。但我想知道如何通过按钮事件而不是通过滑动手势来呈现表格。我不想呈现popover,我喜欢幻灯片动画。任何意见将不胜感激。
答案 0 :(得分:2)
为了将来参考,通过设置拆分视图控制器委托并实现这两种方法,您应该准备好了。
- (void)splitViewController:(UISplitViewController *)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)button
{
//remove button from navigation bar in detail navigation controller
((UINavigationController*)[svc.viewControllers objectAtIndex:1]).topViewController.navigationItem.leftBarButtonItem = nil;
}
- (void)splitViewController: (UISplitViewController*)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController: (UIPopoverController*)pc{
//add button to navigation bar in detail navigation controller
barButtonItem.title = @"Navigation";
((UINavigationController*)[svc.viewControllers objectAtIndex:1]).topViewController.navigationItem.leftBarButtonItem = barButtonItem;
}
barButtonItem的实例为您处理所有切换过程。