2017-10-14 87 views
0

我在做一个应用程序与多细胞的选择(我用复选标记)这样隐藏当细胞被触摸灰色

enter image description here

的问题是,当我点击一个细胞,它仍然灰色,真的很糟糕。我该如何解决它?

回答

4

如果您不希望显示灰色的选择都:

  • 在故事板
  • 选择UITableViewCell在Inspector中,将selected设置为none

你可以找到更多的选择以编程in this answer设置。

0

您可以使用此:

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 
    tableView.deselectRowAtIndexPath(indexPath, animated: true) 
} 

cell.selectionStyle = UITableViewCellSelectionStyle.None 
1

试试这个代码在didSelectRowAt#

cell.selectionStyle = UITableViewCellSelectionStyleNone