UISplitViewController 代理方法
2017-07-06 16:26
435 查看
@protocol UISplitViewControllerDelegate
@optional
1、
// Called when a button should be added to a toolbar for a hidden view controller.
// Implementing this method allows the hidden view controller to be presented via a swipe gesture if 'presentsWithGesture' is 'YES' (the default).
- (void)splitViewController:(UISplitViewController *)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)pc;
代理4返回YES时走此方法,一般实现横屏到竖屏动作:
barButtonItem.title = NSLocalizedString(@"Presidents", @"Presidents");
[self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES];
self.masterPopoverController = popoverController;
2、
// 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;
1代理走后又要出现左边导航时调用,一般实现:
[self.navigationItemsetLeftBarButtonItem:nilanimated:YES];
self.masterPopoverController = nil;
3、
// Called when the view controller is shown in a popover so the delegate can take action like hiding other popovers.
- (void)splitViewController:(UISplitViewController *)svc popoverController:(UIPopoverController *)pc willPresentViewController:(UIViewController *)aViewController;
这发生在portrait模式下,用户单击屏幕上方的按钮弹出导航UIPopoverController信息时走此方法。
4、
// Returns YES if a view controller should be hidden by the split view controller in a given orientation.
// (This method is only called on the leftmost view controller and only discriminates portrait from landscape.)
- (BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation NS_AVAILABLE_IOS(5_0);
一般不实现
@end
相关文章推荐
- UISplitViewController代理方法
- IOS UISplitViewController之 解决 密码框添加之后 调用子视图的转向方法之时 对象为空
- 【iOS开发-107】UISplitViewController:如何取得master和detail控制器,核心在于如何运用代理
- UISplitViewController基本使用方法
- 最简单实现侧边栏的方法----UISplitViewController
- 分割视图控制器(UISplitViewController)
- iPad 自定义UISplitViewController 无法横屏的解决办法。
- UISplitViewController的实现中遇到的问题
- UISplitViewController
- UISplitViewController 只能用在最开始的 window.rootViewController
- iPad 用xib如何创建UISplitViewController应用程序
- 用UICollectionView及其controller相关UICollectionViewDataSource,UICollectionViewDelegate代理实现多列显示方法
- UISplitViewController在Portrait时也为分割窗口
- iPad开发专有API-UIPopoverViewController和UISplitViewController
- UISplitViewController-分割控件自定义分割宽度是无法实现的
- UIViewController与UISplitViewController之间的切换
- ipad 自定义UISplitViewController
- ipa 开发常用控件 : UISplitViewController , UIPopoverController
- UIPickerView在UIPopoverController中正确显示方法
- ios-使用iPad专用API(UISplitViewController)控制器