ios - Swift:放置在 tableviewcell 中的图像不可见

标签 ios swift swift3

enter image description here enter image description here

enter image description here

enter image description here

public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

  let cell = UITableViewCell(style: UITableViewCellStyle.default, reuseIdentifier: "approve_cell");
  let event = self.events[indexPath.row];
  cell.textLabel?.text = event.name;
  return cell;
 }

我在 tableviewcell 中放置了 2 个图像和一个标签。当我运行该应用程序时,图像不可见。可能是什么原因?

最佳答案

检查您没有使用 UITableViewCell 的基本样式,因为如果您使用了,那么该样式仅包含标签……没有 ImageView 。将其更改为副标题或其中一个细节。

有关引用,请参阅:https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html

关于ios - Swift:放置在 tableviewcell 中的图像不可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45625608/

相关文章:

c# - Xamarin表单-C#-异步和等待不起作用?

ios - iOS App 如何不收取带宽费用?

swift - 从一个信号触发的 firebase 云功能发送 voip 推送通知

ios - 动态调整 UITableView 的大小,它将显示为不可滚动的内容列表

iphone - 显示搜索时,UITableView 被新的 UITableView 隐藏

ios - 如何在应用程序中显示 apns token ?在 swift 4

swift - Swift 5 中的 XOR?

ios - Swift 编译器问题 : Compiler doesn't compile long parameters array for Alamofire post request

ios - 单个 IB 约束的简单编程修改不更新

swift - 如何在 Swift3 中为标签的 html 文本加粗