在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
是因为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)
|
请发表评论