我的VC 中有一个UIButton
这样的单元格UITableView
arrowBtnUp = [UIButton buttonWithType:UIButtonTypeCustom];
arrowBtnUp.frame = CGRectMake(50,(65-19)/2,31, 31);
[arrowBtnUp setBackgroundImage:[UIImage imageNamed:@"arrow_up.png"] forState:UIControlStateNormal];
[arrowBtnUp addTarget:self action:@selector(slideAction) forControlEvents:UIControlEventTouchUpInside];
[cell.contentView addSubview:arrowBtnUp];
这是我的slideAction
-(void) slideAction
{
[arrowBtnUp setBackgroundImage:[UIImage imageNamed:@"arrow_down.png"] forState:UIControlStateNormal];
// also tried with UIControlStateSelected/Highlighted
}
但它没有用。我找到了这个链接但没有帮助。任何建议或样品将不胜感激。