【问题标题】:Value of type 'UIImage' has no member 'image''UIImage' 类型的值没有成员 'image'
【发布时间】:2016-06-18 10:31:40
【问题描述】:

在我的 X-Code 项目中 thumbImg 是 UIImage 。当我输入 thumbImg.image 时说 Value of type 'UIImage' has no member 'image' 。我不知道为什么会这样。请帮帮我

我正在使用 Xcode 7.3.1

我正在添加它的图像:

【问题讨论】:

    标签: swift2 uiimage ios9


    【解决方案1】:

    使用这个:thumImg 已经声明为 UIImage

     thumbImg = UIImage(named: "\(self.pokemon.pokedexId)")
    

    或者你可能希望你的 thumbImg 是 UIImageView 而不是 UIImage

    【讨论】:

    • 这行得通,为什么说 UIImage 没有“图像”成员。我已经看到 UIImage 中有那个图像成员的教程。?? :(
    • 不可能老实说,一个 UIImage 没有图像.. 它本身就是一个图像。但是你一定把它和 UIImageView 搞混了。
    • 因为 UIImageView 确实有图像,因为它是包含图像的“视图”
    猜你喜欢
    • 2016-03-11
    • 2021-06-17
    • 2016-09-11
    • 1970-01-01
    • 2019-04-27
    • 1970-01-01
    • 1970-01-01
    • 2023-04-07
    • 1970-01-01
    相关资源
    最近更新 更多