ipad特有的两个类——UISplitViewCon…
2016-02-19 09:28
706 查看
以下的两个类是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 (nonatomic, copy) NSArray *viewControllers;
设置他的左右控制器
@property (nonatomic, assign) id <</SPAN>UISplitViewControllerDelegate> delegate;
设置他的代理
一般是右视图控制器做他的代理
默认是竖屏隐藏 横屏显示左视图
以下是他的代理方法:
- (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 (nonatomic) CGSize 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 可以用代理
但是通知中心是最慢的 代理快多了
NS_CLASS_AVAILABLE_IOS(3_2) @interface UISplitViewController : UIViewController
@interface UIPopoverController : NSObject <</SPAN>UIAppearanceContainer>
*******
NS_CLASS_AVAILABLE_IOS(3_2) @interface UISplitViewController : UIViewController
显示左右控制器
@property (nonatomic, copy) NSArray *viewControllers;
设置他的左右控制器
@property (nonatomic, assign) id <</SPAN>UISplitViewControllerDelegate> delegate;
设置他的代理
一般是右视图控制器做他的代理
默认是竖屏隐藏 横屏显示左视图
以下是他的代理方法:
- (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 (nonatomic) CGSize 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 可以用代理
但是通知中心是最慢的 代理快多了
相关文章推荐
- UGUI之Image使用以及技能释放CD
- UE正则表达式查找和替换(将【,;】)替换为换行
- 面试behavior questions 回答
- UISearchBar小技巧
- Mysql 客户端连不上服务器,以及mongoVue连不上mongo问题解决
- jar包,用proguardgui 进行混淆
- guidelines for contributing Hearthstone-Deck-Tracker
- TYPE Directive in FOR XML Queries(FOR XML查询中的TYPE指令)
- Win10 Build 14267截图欣赏:贴心功能大展示
- Leetcode 334. Increasing Triplet Subsequence
- 【翻(xue)译(xi)】3D Game Programming With DirectX11 - 6.1
- 【翻(xue)译(xi)】3D Game Programming With DirectX11 - 5.13
- 【翻(xue)译(xi)】3D Game Programming With DirectX11 - 5.12
- 【翻(xue)译(xi)】3D Game Programming With DirectX11 - 5.11
- 【翻(xue)译(xi)】3D Game Programming With DirectX11 - 5.10
- 【翻(xue)译(xi)】3D Game Programming With DirectX11 - 5.9
- 【翻(xue)译(xi)】3D Game Programming With DirectX11 - 5.8
- 【翻(xue)译(xi)】3D Game Programming With DirectX11 - 5.7
- 【翻(xue)译(xi)】3D Game Programming With DirectX11 - 5.6
- 【翻(xue)译(xi)】3D Game Programming With DirectX11 - 5.5