2016-11-11 45 views
1

在我的UITableViewController的自定義類,我在cellRowRowAtIndexPath使用此:的UITableViewController selectionStyle沒有不工作

cell?.selectionStyle = .none 

選擇顏色但是仍然灰色

+0

試試這個'cell.selectionStyle = .none' – Rajat

+0

你可以使用cell.selectionStyle = .none或者您可以設置從stroyBoard –

+0

單元選擇的風格沒有哪一個版本SWIFT 2或3 ? – vaibhav

回答

0

它應該是這樣的,

let cell = tableView.dequeueReusableCell(withIdentifier: "Cell")! as 
    UITableViewCell 
    cell.selectionStyle = .none 
1

cell.selectionStyle = none



StoryBoard您可以選擇cell selection style None

enter image description here