简体   繁体   中英

Icons on the UIAlert Controller

Does anyone know how to add icons in the UI Alert Controller the way the Pages App has it as attached i the image below.

Thanks in advance. :)

在此处输入图片说明

Yes that is possible. You can try to set image property 0f action. You should probably try out following code

var okAction = UIAlertAction(title: "OK", style: .Default, handler: nil)
let img = UIImage(named: "ico_ok.png")
action.setValue(img, forKey: "image")
alert.addAction(action)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM