2011-01-14 26 views

Trả lời

2

Có một phương pháp đại biểu để đặtelectionstyle thành none.Once này được thiết lập tải lại bảng cho hiệu ứng mong muốn.

20

trong tableView:cellForRowAtIndexPath: phương pháp

sử dụng này

cell.selectionStyle = UITableViewCellSelectionStyleNone

+0

cho 3,0 sử dụng nhanh chóng cell.selectionStyle = UITableViewCellSelectionStyle.none –

0

bạn có thể sử dụng cell.selectionStyle = UITableViewCellSelectionStyleNone;

hoặc

[cell setSelectionStyle:UITableViewCellSelectionStyleNone];

trong cellForRowAtIndexPath dataSource method

0

Viết này trong didSelectRowAtIndexPath:index phương pháp,

cell.selectionStyle = UITableViewCellSelectionStyleNone

HOẶC

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

Công việc được thực hiện bằng cách thiết lập:

cell.selectionStyle = .none

2

bạn có thể sử dụng:

cell.selectionStyle = UITableViewCellSelectionStyleNone; 
Các vấn đề liên quan