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
}
关于popoverPresentationController
最新推荐文章于 2021-07-16 19:41:17 发布