Gug*_*thu 2 ios swift uialertcontroller
有没有人知道如何在UI警报控制器中添加图标的方式与页面应用程序所附的方式相同,如下图所示.
提前致谢.:)
是的,这是可能的.您可以尝试设置动作的图像属性.您应该尝试以下代码
var okAction = UIAlertAction(title: "OK", style: .Default, handler: nil)
let img = UIImage(named: "ico_ok.png")
action.setValue(img, forKey: "image")
alert.addAction(action)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
966 次 |
| 最近记录: |