【问题标题】:Add an animation image per image inside a UIAlertController SWIFT在 UIAlertController SWIFT 中为每个图像添加一个动画图像
【发布时间】:2015-07-07 04:44:39
【问题描述】:

我有一个显示 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 或者我必须完全自定义我的弹出窗口?

【问题讨论】:

    标签: ios swift animation uialertcontroller


    【解决方案1】:

    我不知道自定义 UIAlertController 这样的方法;它们只有三个属性——title、message、preferredStyle 和 textFields——你都不能添加 UIImageView。

    我建议创建一个自定义模式演示控制器。实际上,我只是写了an answer 来说明如何做到这一点。当然,您会将自定义视图居中而不是将其固定在右侧,但该答案至少可以帮助您开始使用 UIPresentationControllers 的古怪世界。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-10-10
      • 2022-01-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-08
      • 1970-01-01
      相关资源
      最近更新 更多