一、cell点击背景色覆盖按钮的背景色
cell默认选中行的颜色是灰色的,如果cell上有按钮等控件,cell的灰色会覆盖控件的背景色
解决方案:在自定义的cell中实现如下两个方法:
-(void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
被覆盖的控件名.backgroundColor = 控件背景色;
}
-(void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {
[super setHighlighted:highlighted animated:animated];
被覆盖的控件名.backgroundColor =控件背景色;
}
网友评论