func shareBtnDidClick(btn: UIButton) {
shareListVC.modalPresentationStyle = .popover
shareListVC.popoverPresentationController?.sourceView = shareBtn
let btnW = shareBtn.bounds.size.width
let btnH = shareBtn.bounds.size.height
shareListVC.popoverPresentationController?.sourceRect = CGRect.init(x: 20.0/102 * btnW,
y: shareListVC.preferredContentSize.height * 0.66//0.66时,permittedArrowDirections必须为[]
, width: btnW, height: btnH)
shareListVC.popoverPresentationController?.delegate = self
shareListVC.delegate = self
//自定义背景View,可解决present出tv的圆角问题。但是会导致 tv的cell点击事件经常不响应!!!😓
// PopoverBackgroundConditioner.shared.arrowColor = .yellow
// PopoverBackgroundConditioner.shared.arrowSize = CGSize.init(width: 1, height: 1)
//可设置隐藏三角形,但是圆角不符合 UI
shareListVC.popoverPresentationController?.permittedArrowDirections = []
// shareListVC.popoverPresentationController?.popoverBackgroundViewClass = PopoverBackgroundView.self
present(shareListVC, animated: true, completion: nil)
}
func shareBtnDidClick(btn: UIButton) {
// PopoverBackgroundConditioner.shared.arrowColor = .yellow
// PopoverBackgroundConditioner.shared.arrowSize = CGSize.init(width: 1, height: 1)
//可设置隐藏三角形,但是圆角不符合 UI
shareListVC.popoverPresentationController?.permittedArrowDirections = []
// shareListVC.popoverPresentationController?.popoverBackgroundViewClass = PopoverBackgroundView.self