【发布时间】:2017-08-11 20:24:16
【问题描述】:
所以我构造检索数据的方式是;
结构框架图片 { 让 imagedB :数据! 让 pricedB :字符串! }
我已成功检索数据,但我不知道如何在 tableView 上设置图像?我已经设法用标签弄清楚了......但不是用图片?
这是表格中单元格的代码;
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell: RowCellTableView = myTableView.dequeueReusableCell(withIdentifier: "cell") as! RowCellTableView
// sets label
cell.priceView.text = framePics[indexPath.row].pricedB
// set image on UIimageView???
--- I dont know how to add this? I need somehow to get the list of only the images??? I believe if I had the array variable like; imageFiles[] I could have done;
imageFiles[indexPath.row].getDataInBackground... But in my case I use struct so how am I supposed to do this in this case?
RowCellTableView 只包含;
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var priceView: UILabel!
【问题讨论】:
标签: ios swift firebase firebase-realtime-database tableview