如何将图像加载到游乐场

问题描述 投票:-1回答:1

[在操场上的应用程序中,我正在尝试上传图片,我用Google搜索它,许多解决方案说我需要将图片放入资源中。但是情况是,在新的Playground应用中,没有资源文件夹,这就是为什么我无法添加图像的原因。有共享的Sources和Xcode源代码,但是在这些文件中,我无法放置图像。

这可能是一个简单的问题,但我很难解决。为了继续我的项目,这一点让我很生气。谢谢

如您所见,没有任何资源可以让我放置我的图片as you can see, there aren't resources that ı could put my image

存在用于添加图像的空间,但是在这种情况下,问题是在选择我的图像之后,什么都没发生

there is space for adding an image but in this case, the problem is that after ı chose my image nothing happened

swift file-upload uiimageview swift-playground
1个回答
0
投票

[UIImage可以像这样加载到Playground应用程序,

  1. 文件->新的空白游乐场。
  2. 单击右上角的'+'图标,然后单击Insert from...选项选择图片。
  3. 从操场上加载图像及其名称。

    UIImage(named:“ test.png”)

Output with loaded image

© www.soinside.com 2019 - 2024. All rights reserved.