【问题标题】:How to add icons to options in action sheets : iOS?如何将图标添加到操作表中的选项:iOS?
【发布时间】:2019-02-15 07:08:14
【问题描述】:

我正在尝试在 iOS 应用的操作表中添加图标。我看到苹果已经在 AppStore 的操作表中实现了这样的行为,但没有提供任何回调方法来实现它?

关于如何在 iOS 12 Swift 4.x Xcode10.x 上实现它有什么建议吗??

【问题讨论】:

标签: ios swift xcode uialertcontroller


【解决方案1】:

您可以使用image 键将图像添加到UIAlertAction

let image = UIImage(named: "IMAGE_NAME")
var alertAction = UIAlertAction(title: "TITLE", style: .default, handler: nil)
alertAction.setValue(image, forKey: "image")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-08-11
    • 2018-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-10
    • 2013-06-11
    相关资源
    最近更新 更多