ipad特有的两个类——UISplitViewCon…

以下的两个类是ipad特有的

NS_CLASS_AVAILABLE_IOS(3_2) @interface UISplitViewController UIViewController

@interface UIPopoverController NSObject <</SPAN>UIAppearanceContainer

 

 

 

 

*******

NS_CLASS_AVAILABLE_IOS(3_2) @interface UISplitViewController UIViewController

显示左右控制器  

@property (nonatomiccopyNSArray *viewControllers;  

设置他的左右控制器

@property (nonatomicassignid <</SPAN>UISplitViewControllerDelegatedelegate;

设置他的代理

一般是右视图控制器做他的代理

默认是竖屏隐藏 横屏显示左视图

 

以下是他的代理方法:

 

(BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation NS_AVAILABLE_IOS(5_0);

如果想要一直显示 需要实现他的这个代理方法, 返回NO  一直显示  YES横竖都不显示

 

(void)splitViewController:(UISplitViewController *)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem

左视图即将显示时 调用

他的barButtonItem自动带点击事件,点击会显示左视图

CocoaLigature1 但前提是不实现上面的shoud的代理方法

 

 

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

左视图即将隐藏时调用

 

 

 

 

@interface UIPopoverController NSObject <</SPAN>UIAppearanceContainer>

气泡显示控制器

(id)initWithContentViewController:(UIViewController *)viewController;

气泡中要显示的view

@property (nonatomicCGSize popoverContentSize;

气泡大小

 

(void)presentPopoverFromBarButtonItem:(UIBarButtonItem *)item permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated;

设置气泡从哪个视图上弹出来 弹出方向(只能是导航栏)

 

(void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated;

气泡可以从任意位置弹出来

从父视图view上的指定位置弹出来

 

(void)dismissPopoverAnimated:(BOOL)animated;

气泡消失的方法

 

****

通知中心适合一对多传参

气泡可以用通知中心通知调用他的vc  可以用代理

但是通知中心是最慢的  代理快多了

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值