UISplitViewController 代理方法

15 篇文章 0 订阅

 

 

@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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值