简体   繁体   English

将 imageView 添加到 TableView 控制器中的 TableView 单元格

[英]Adding imageView to TableView cell in TableView Controller

I am trying to add imageView to TableView cell in TableView Controller, but it doesn't show anything, anyone can help me with this question?我正在尝试将 imageView 添加到 TableView 控制器中的 TableView 单元格,但它没有显示任何内容,任何人都可以帮助我解决这个问题吗? (case 0) (案例0) 在此处输入图片说明 在此处输入图片说明 I connected Avatar to image view in storyboard, named and connected all classes.我将 Avatar 连接到故事板中的图像视图,命名并连接所有类。

  1. You are saying it doesn't show anything.你说它没有显示任何东西。 Can you describe in detail what is not showing Image or the ImageView.你能详细描述什么没有显示 Image 或 ImageView。
  2. Can you also show what exactly you can see on the simulator or device?您还可以展示您在模拟器或设备上可以看到的确切内容吗?
  3. Try to debug the View Hierarchy and see whether the image is appearing but is being obfuscated by say white background of ImageView.尝试调试视图层次结构并查看图像是否出现但被 ImageView 的白色背景混淆。
  4. Try changing the constructor you are using UIImage(systemName: String) is used for loading system provided images.尝试更改您使用的构造函数 UIImage(systemName: String) 用于加载系统提供的图像。 If you are trying to load an image from Assets.xcassets folder use UIImage(named: String).如果您尝试从 Assets.xcassets 文件夹加载图像,请使用 UIImage(named: String)。
  5. Lastly, just make sure the image you are trying to load exists and you are using the correct name.最后,只需确保您尝试加载的图像存在并且您使用了正确的名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM