self.Vc.modalPresentationStyle = UIModalPresentationPopover;
self.Vc.popoverPresentationController.sourceView = 自定义btn;
self.Vc.popoverPresentationController.sourceRect = 自定义btn.bounds;
self.Vc.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
//设置代理
self.Vc.popoverPresentationController.delegate = self;
#pragma mark --PopoverDelegate
//使得popoverController 在iphone 可以使用
-(UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller {
//显示我自己设置的样式
return UIModalPresentationNone;
}
Swift Popover 显示配置
本文介绍了如何在Swift中配置并展示Popover视图控制器,包括设置显示样式、来源视图及边界、允许的方向等属性,并通过代理方法确保Popover在iPhone设备上的正常显示。
402

被折叠的 条评论
为什么被折叠?



