2011-01-14 7 views

Antwort

2

Es gibt eine Delegate-Methode, um selectionstyle auf none zu setzen. Sobald dies eingestellt ist, hat das erneute Laden der Tabelle den gewünschten Effekt.

20

in tableView:cellForRowAtIndexPath: Methode

Verwendung dieses

cell.selectionStyle = UITableViewCellSelectionStyleNone

+0

für rasche 3.0 Verwendung cell.selectionStyle = UITableViewCellSelectionStyle.none –

0

können Sie cell.selectionStyle = UITableViewCellSelectionStyleNone;

oder

[cell setSelectionStyle:UITableViewCellSelectionStyleNone];

inverwenden

0

schreiben, um diese in didSelectRowAtIndexPath:index Methode

cell.selectionStyle = UITableViewCellSelectionStyleNone

OR

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

Die Aufgabe wird durch die Einstellung getan:

cell.selectionStyle = .none

2

können Sie:

cell.selectionStyle = UITableViewCellSelectionStyleNone; 
Verwandte Themen