滑动手势很酷,可以纵向呈现主视图。但我想知道如何通过按钮事件而不是通过滑动手势来呈现表格。我不想呈现popover,我喜欢幻灯片动画。任何意见将不胜感激。
问问题
553 次
1 回答
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 的实例为您处理所有切换过程。
于 2013-03-12T15:44:11.927 回答