我有一个显示 UIAlertController 的函数。在标题和文本下方,我想为每张图片显示一张动画图片。我有 13 张图像要循环。
func alertDownloadInProgress(text:String, sender:UIViewController) -> UIAlertController {
var alert = UIAlertController(title: "Alert", message: text, preferredStyle: UIAlertControllerStyle.Alert)
sender.presentViewController(alert, animated: true, completion: nil)
return alert
}
是否可以使用 UIAlertController 或我必须完全自定义我的弹出窗口?
最佳答案
我不知道有什么方法可以像那样自定义 UIAlertController;它们只有三个属性——title、message、preferredStyle 和 textFields——您不能向其中添加 UIImageView。
我建议创建一个自定义模态呈现 Controller 。我实际上只是写了an answer关于如何做到这一点。当然,您会将自定义 View 居中而不是将其固定在右侧,但该答案至少可以帮助您开始了解 UIPresentationController
的古怪世界。
关于ios - 在 UIAlertController SWIFT 中为每个图像添加一个动画图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31254931/