2011-01-14 21 views
6

चुनते समय चयन प्रभाव अक्षम करें यदि कोई विशेष UITableViewCell चुनते समय चयन प्रभाव को अक्षम कैसे कर सकता हूं?UITableViewCell

उत्तर

2

किसी भी विकल्प को चयन करने के लिए कोई प्रतिनिधि तरीका नहीं है। एक बार यह तालिका को फिर से लोड करने के लिए वांछित प्रभाव देता है।

tableView:cellForRowAtIndexPath: में
20

विधि

उपयोग इस

cell.selectionStyle = UITableViewCellSelectionStyleNone

+0

cell.selectionStyle = UITableViewCellSelectionStyle.none –

0

आप उपयोग कर सकते cell.selectionStyle = UITableViewCellSelectionStyleNone;

या

[cell setSelectionStyle:UITableViewCellSelectionStyleNone];

में didSelectRowAtIndexPath:index विधि में

0

लिखें इस,

cell.selectionStyle = UITableViewCellSelectionStyleNone

या

[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; 
तेज 3.0 उपयोग के लिए