UIPopoverController
2018-05-14 本文已影响0人
絮语时光杨
iPad开发中常见的一种控制器
- (id)initWithContentViewController:(UIViewController*)viewController;
@property (nonatomic, retain) UIViewController*contentViewController;
- (void)setContentViewController:(UIViewController*)viewController animated:(BOOL)animated;
UIPopoverController上面的内容必须由另外一个继承自UIViewController的控制器来提供,这个控制器称为“内容控制器”
-
(void)setPopoverContentSize:(CGSize)sizeanimated:(BOOL)animated;
-
(void)presentPopoverFromBarButtonItem:(UIBarButtonItem*)item permittedArrowDirections:(UIPopoverArrowDirection)arrowDirectionsanimated:(BOOL)animated;
item :围绕着哪个UIBarButtonItem显示
arrowDirections:箭头的方向
animated:是否通过动画显示出来
围绕着某一块特定区域显示(箭头指定那块特定区域)
- (void)presentPopoverFromRect:(CGRect)rectinView:(UIView*)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDirectionsanimated:(BOOL)animated;
rect :指定箭头所指区域的矩形框范围(位置和尺寸)
view :rect参数是以view的左上角为坐标原点(0,0)
arrowDirections:箭头的方向
animated:是否通过动画显示出来