关于popoverPresentationController

来源:互联网 发布:淘宝打不开微信链接 编辑:程序博客网 时间:2024/06/07 10:29

这里写图片描述
popoverPresentationController 就是上面的样子
所在的父控制器遵循协议
实例化一个UIViewConteroller * VC
VC.modalPresentationStyle = UIModalPresentationPopover;
VC.popoverPresentationController.sourceView = sender;//箭头方向指向
VC.popoverPresentationController.sourceRect = sender.bounds;
VC.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionUp;//箭头方向,如果是baritem不设置方向,会默认up,up的效果也是最理想的
VC.popoverPresentationController.delegate = self;
代理方法
- (BOOL)popoverPresentationControllerShouldDismissPopover:(UIPopoverPresentationController *)popoverPresentationController{
return YES;//点击蒙版popover不消失, 默认yes
}

0 0
原创粉丝点击