【问题标题】:How to show image title instead of icon in xcode code?如何在 xcode 代码中显示图像标题而不是图标?
【发布时间】:2017-08-18 01:59:18
【问题描述】:

我正在写一个非常简单的行,但我很难看到我实际写了什么,因为我的图像标题在 xcode 中显示为图标。

我想把它看成:

thing.image = picture.png

但我认为它是:

thing.image = an actual icon is here in the code for some weird purpose I can't understand

我没有运气搜索过。任何帮助是极大的赞赏。谢谢!

**edit:我假设它是一个图标占位符...它显示为一个小白框。

**edit:这是我的代码的外观:

【问题讨论】:

  • 有截图吗?
  • 图片标题是什么?,尝试更改图片标题
  • 它们是文字,如果你想使用图像名称,那么你可以像UIImage(named: "picture")

标签: ios swift xcode image icons


【解决方案1】:

相关:我喜欢文字;要在事后找出图像的名称,让 Xcode 通过选择文字来显示图像资产的名称,然后按Cmd-E,“使用选择进行查找”。图片的名称将显示在查找栏中,例如#imageLiteral(resourceName: "icn_spinner")

或者,按Cmd-/ 将行注释掉;注释表单包含文字。

【讨论】:

  • 注释方式实际上允许你编辑值。
【解决方案2】:

高亮图像并按Ctrl + F,然后图像名称将出现在工具栏中。

【讨论】:

    【解决方案3】:

    将图像分配给 UIImageView

    thing.image = UIImage(named:"picture.png")
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-07
      • 1970-01-01
      • 2013-01-14
      • 2013-03-12
      • 2018-04-26
      • 1970-01-01
      相关资源
      最近更新 更多