ios - 在 UIAlertController SWIFT 中为每个图像添加一个动画图像

标签 ios swift animation uialertcontroller

我有一个显示 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/

相关文章:

ios - 如何将 ImageView 及其属性从一个 View Controller 传递到另一个 View Controller ?

ios - 核心动画在今天的扩展中是不可能的吗

ios - 异步任务队列不起作用 (SWIFT)

swift - 无法搜索自定义 CBUUID

jquery - 如何在jQuery中为每个动画设置不同的帧速率

c# winforms 如何旋转图像(但不围绕其中心旋转)

c++ - C++/SDL/OpenGL 中的平滑动画问题

ios - 在 PageTabViewStyle (SwiftUI 2.0) 或 PageViewController/PageView (带有 UIKit 界面) 上显示部分上一个和下一个项目

swift - 在打印时显示的 TextView 中可选

swift - 从闭包中抛出错误