首页 > 移动平台 > 详细

iOS swift ipad使用系统自带分享 弹框失败没有弹框

时间:2020-06-09 12:41:16      阅读:46      评论:0      收藏:0      [点我收藏+]

 

是因为iOS13上的不支持适配

let activity = UIActivityViewController(activityItems: [URL(fileURLWithPath: path)], applicationActivities: nil)
        
        activity.excludedActivityTypes = [.print]
        
        //需要做一个 iPhone 和 iPad的判断
        if UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.pad {
            activity.modalPresentationStyle = .popover
            activity.popoverPresentationController?.sourceView = self.view
            activity.popoverPresentationController?.sourceRect = CGRect(x: Screen.width, y: Screen.height/2, width: 0, height: 0)
            activity.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0)
        }
        self.present(activity, animated: true, completion: nil)

 

iOS swift ipad使用系统自带分享 弹框失败没有弹框

原文:https://www.cnblogs.com/xujiahui/p/13071656.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!