[英]Size of a photo in a cell, inside TableView
我需要把照片的具體尺寸。 在 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
}
您需要在單元格本身的Storyboard
或.xib
中設置特定的imageView
大小。
如果您不使用Storyboard
或.xib
,您也可以通過編程方式設置它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.