【发布时间】:2019-11-20 09:46:46
【问题描述】:
我需要把照片的具体尺寸。 在 imageView.image 字段中
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Quiz Cell", for: indexPath)
let row = indexPath.row
let quiz = model.quizzes[row]
cell.textLabel?.text = quiz.question
cell.detailTextLabel?.text = quiz.author?.username ?? "Anónimo"
cell.imageView?.image = UIImage(named: "none")
return cell
}
【问题讨论】:
-
上面的代码有什么问题?在 QUIZ 单元格中设置图像的高度和宽度
-
有什么问题?
-
您必须在测验单元格中设置它,请提供您的单元格的代码。
-
代码没有问题。但是我需要设置图像的具体尺寸,我可以在哪里设置这些值?
标签: ios swift uitableview uikit