2011-01-14 3 views

Répondre

2

Il existe une méthode déléguée à setselectionstyle à none.Une fois que ceci est défini, le rechargement de la table donne l'effet désiré.

20

dans tableView:cellForRowAtIndexPath: méthode

utiliser cette

cell.selectionStyle = UITableViewCellSelectionStyleNone

+0

pour 3.0 rapide utilisation cell.selectionStyle = UITableViewCellSelectionStyle.none –

0

vous pouvez utiliser cell.selectionStyle = UITableViewCellSelectionStyleNone;

ou

[cell setSelectionStyle:UITableViewCellSelectionStyleNone];

en cellForRowAtIndexPath dataSource method

0

écrire cette méthode dans didSelectRowAtIndexPath:index,

cell.selectionStyle = UITableViewCellSelectionStyleNone

OU

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

2

Swift 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 
    } 

Le travail se fait en réglant:

cell.selectionStyle = .none

2

vous pouvez utiliser:

cell.selectionStyle = UITableViewCellSelectionStyleNone; 
Questions connexes