uitabview 自定义选中颜色

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

{

UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath];

UIView *bgColorView = [[UIView alloc] init];

[bgColorView setBackgroundColor:[UIColor redColor]];

[cell setSelectedBackgroundView:bgColorView];

[cell.backgroundView addSubview:bgColorView];

[UIView animateWithDuration:0.2 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^

{

[bgColorView setAlpha:0];

}

completion:^(BOOL finished)

{

[bgColorView removeFromSuperview];}

];

[bgColorView release];

}

你可能感兴趣的:(view)