【发布时间】:2015-12-04 18:09:45
【问题描述】:
我正在使用 UITableViewRowAction 在 iOS Swift 2 中编辑表格。如果他们在动作按钮弹出后选择动作,我希望整个单元格的当前背景(不是按钮弹出窗口)改变颜色。我尝试使用 dequeueReusableCellWithIdentifier 访问它,但没有任何反应。
let share = UITableViewRowAction(style: .Normal, title: "Showed Up?") { (action, indexPath) in
let cell = tableView.dequeueReusableCellWithIdentifier("secondtableCell", forIndexPath: indexPath)
cell.backgroundColor = UIColor.redColor()
...当然,代码稍后会继续关闭。除了颜色变化外,一切都按预期工作。
【问题讨论】:
-
你检查过这个答案吗:stackoverflow.com/a/19238919/558933
标签: ios swift2 uitableviewrowaction