2017-10-14 89 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