如何在UIAlertController的第一个动作中添加tableview的截图?我试着那样做
let actionSheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
let action = UIAlertAction(title: NSLocalizedString("Share routine", comment: ""), style: .default, handler: { _ in
})
action.setValue(image, forKey: "image")
actionSheet.addAction(action)
actionSheet.addAction(UIAlertAction(title: NSLocalizedString("Cancel", comment: ""), style: .cancel, handler: nil))
UIApplication.topViewController()?.present(actionSheet, animated: true, completion: nil)发布于 2018-07-18 20:24:18
我试过你的代码,发现了一些错误
首先,不要使用图片
image.withRenderingMode(.alwaysOrigin)如果你想把你的图片放到某个位置,使用imageView
发布于 2018-07-18 20:20:50
action.setValue(myImage.withRenderingMode(.alwaysOriginal), forKey: "image")我需要添加.withRenderingMode(.alwaysOriginal) <-这是正确的形象。感谢所有人的帮助
https://stackoverflow.com/questions/51401552
复制相似问题