【发布时间】:2017-08-30 07:42:47
【问题描述】:
我有一个 tableview 单元格,里面有图像视图、标签和一个 ui 按钮,我需要在点击时更改按钮标题文本和背景颜色。但是当我尝试从多个单元格中做按钮时,效果是一样的。请帮帮我!
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell1", for: indexPath) as! subTableViewCell
cell.catNameLabel.text = categoryNameArray[indexPath.row]
cell.descLabel.text = descriptionArray[indexPath.row]
cell.freqLabel.text = frequency[indexPath.row] + " at " + frequencyTime[indexPath.row]
let url = "http://wiinnova.com/tenly/image/category_image/\(categoryImageArray[indexPath.row])"
cell.img.imageFromServerURL(urlString: url)
cell.button.tag = indexPath.row
return cell
}
【问题讨论】:
-
点击按钮时重新加载你的tableview
-
我重新加载但没有变化..同样的问题