1、修改 accessoryView 为UIButton,添加按下效果 :
UIButton *accessBtn = [[UIButton alloc] init];
accessBtn.frame = CGRectMake(0, 0, 15/2.0, 13);
[accessBtn setImage:[UIImage imageNamed:@"content_icon_nextpage_nor"] forState:UIControlStateNormal];
[accessBtn setImage:[UIImage imageNamed:@"content_icon_nextpage_sel"] forState:UIControlStateHighlighted];
cell.accessoryView = accessBtn;
2、自定义 UITableViewCell,重写以下方法:
-(void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{
if (highlighted == YES) {
((UIButton *)self.accessoryView).highlighted = YES;
}else{
((UIButton *)self.accessoryView).highlighted = NO;
}
[super setHighlighted:highlighted animated:animated];
}