Implement cell click highlighting

1:设置cell.selectionStyle = UITableViewCellSelectionStyleNone;

2: Rewrite in the .m of the cell

- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{//重写高亮函数
    if (highlighted)

 

- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{//Rewrite the highlight function

    if (highlighted) {

        self.backgroundColor = [UIColorChange colorwithHexString:COLOROFLINE];

    }else{

        self.backgroundColor = [UIColor whiteColor];

    }

}

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327079499&siteId=291194637