2011-01-14 77 views

回答

2

有一種將setselectionstyle設置爲none的委託方法。一旦設置了重新加載表,就會產生所需的效果。

20

tableView:cellForRowAtIndexPath:方法

使用本

cell.selectionStyle = UITableViewCellSelectionStyleNone

+0

爲SWIFT 3.0使用cell.selectionStyle = UITableViewCellSelectionStyle.none – 2017-02-24 13:59:37

0

可以使用cell.selectionStyle = UITableViewCellSelectionStyleNone;

[cell setSelectionStyle:UITableViewCellSelectionStyleNone];

cellForRowAtIndexPath dataSource method

0

寫入這在didSelectRowAtIndexPath:index方法,

cell.selectionStyle = UITableViewCellSelectionStyleNone

OR

[self.tblName deselectRowAtIndexPath:indexPath animated:NO];

2

夫特3.0

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 
    let cell = tableView.dequeueReusableCell(withIdentifier: "CellIdentifier", for: indexPath) as! UITableViewCell 
    cell.selectionStyle = .none 
    return cell 
    } 

作業是通過設置:

cell.selectionStyle = .none

2

你可以使用:

cell.selectionStyle = UITableViewCellSelectionStyleNone;