美文网首页
UITableViewCell HighLighted 自定义高

UITableViewCell HighLighted 自定义高

作者: 突刺刺 | 来源:发表于2018-01-19 16:55 被阅读10次

自定义cell

这里设置bgView或者contentview的颜色,等于cell高亮状态的颜色

- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
{
    [super setHighlighted:highlighted animated:animated];
    self.selectedBackgroundView = [[HYView alloc] initWithColor:[UIColor redColor]];
}

UITableViewDelegate 的代理方法

设置cell的反选中效果

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

相关文章

网友评论

      本文标题:UITableViewCell HighLighted 自定义高

      本文链接:https://www.haomeiwen.com/subject/trqaoxtx.html