disable the uitableview highlighting but allow the selection of individual cells

前端 未结 12 1243
心在旅途
心在旅途 2020-12-07 18:29

when you tap on a cell the row gets selected and highlighted.Now what i want to do is disable the highlighting but allow the selection.Is there a way around it.There is ques

12条回答
  •  抹茶落季
    2020-12-07 19:03

    For Swift:

    UITableViewCell.selectionStyle = UITableViewCellSelectionStyle.None;

    Or when you subclass a cell in swift:

    class CustomCell : UITableViewCell {
    
        required init(coder aDecoder: NSCoder) {
            super.init(coder: aDecoder)!
            selectionStyle = .None
        }
    
    }
    

提交回复
热议问题