【发布时间】:2020-04-04 15:19:16
【问题描述】:
我创建了自定义 UIActivity 并使用我的图像覆盖了变量 activityImage。
fileprivate extension UIActivity.ActivityType {
static let extendedMessage =
UIActivity.ActivityType("ExtendedMessage")
}
自定义 UIActivity:
fileprivate class ExtendedMessageActivity: UIActivity {
private let phoneNumbers: [String]
private var message: String?
init(phoneNumbers: [String]) {
self.phoneNumbers = phoneNumbers
super.init()
}
override static var activityCategory: UIActivity.Category {
return .share
}
override var activityType: UIActivity.ActivityType? { return .extendedMessage }
override var activityTitle: String? { return NSLocalizedString("Message", comment: "") }
override var activityImage: UIImage? {
return UIImage(named: "message-app-icon")
}
override func canPerform(withActivityItems activityItems: [Any]) -> Bool {
....
}
override func prepare(withActivityItems activityItems: [Any]) {
....
}
override func perform() {
....
}
}
The image appears in the set. I have a problem the image does not appear when it is in the "More" menu item. 为什么图片没有出现?
【问题讨论】:
标签: ios