【问题标题】:Xcode 10: The Image set 'customloading' reference a file "mygif.gif" , but that file does not have a valid extensionXcode 10:图像集“customloading”引用文件“mygif.gif”,但该文件没有有效的扩展名
【发布时间】:2018-11-24 02:05:19
【问题描述】:

我将我的 xcode9 更新为 xcode10,然后我的应用程序上的 gif 突然无法查看我的 gif。然后当我去我的资产时。出现。

class CustomLoading: UIView {

    static let instance = CustomLoading()
    var viewColor: UIColor = .brown
    var setAlpha: CGFloat = 2.0
    var gifName: String = "customloading"

    lazy var transparentView:  UIView = {

        let transparentView = UIView(frame: UIScreen.main.bounds)
        transparentView.backgroundColor = UIColor.white.withAlphaComponent(setAlpha)
        transparentView.isUserInteractionEnabled = false
        return transparentView

    }()

【问题讨论】:

  • 您好 @Guren,欢迎来到 StackOverflow,您可以查看 "how to ask" 以改进这个和未来的问题。特别是你应该提供一些"research effort"和/或一些代码,以证明你已经尝试过自己解决问题。
  • 您好,先生。我已经对这个问题进行了研究,但我仍然找不到答案。我的代码运行顺利,当我将 xcode 版本升级到 10 时,我收到了警告。并且加载屏幕在那里,但 gif 不会加载。
  • @Guren 你有同样的解决方案吗?
  • 很遗憾,不是先生。 @techsavvy

标签: ios xcode


【解决方案1】:

xcode 10 不支持资产上的 gif,所以我在资产文件夹之外调用它

【讨论】:

    猜你喜欢
    • 2012-10-16
    • 2011-10-27
    • 1970-01-01
    • 2012-01-18
    • 2015-12-14
    • 2016-12-24
    • 1970-01-01
    • 1970-01-01
    • 2016-06-28
    相关资源
    最近更新 更多