yourcell.mm中
-(void)willTransitionToState:(UITableViewCellStateMask)state
{[super willTransitionToState:state];
if ((state & UITableViewCellStateShowingDeleteConfirmationMask) == UITableViewCellStateShowingDeleteConfirmationMask)
{
//显示删除btn
}
else
{
}
}
viewheader
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
if (_Array.count == 0)
{
return nil;
}
else
{
UIImageView *image= [[[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, width, h)] autorelease];
image.backgroundColor = [UIColor blackcolor];
image.alpha = 0.9f;
UILabel * headerLabel = [[UILabel alloc] initWithFrame:CGRectZero];
headerLabel.backgroundColor = [UIColor clearColor];
headerLabel.opaque = NO;
headerLabel.textColor = [UIColor whiteColor];
headerLabel.font = [UIFont boldSystemFontOfSize:16];
headerLabel.frame = CGRectMake(10.0, -10.0, 300.0, 45);
NSString *key = [_Array objectAtIndex:section];
if ([key isEqualToString:@"*"])
{
headerLabel.text = @"常用联系人";
}
else
{
headerLabel.text = [_Array objectAtIndex:section];
}
[image addSubview:headerLabel];
[headerLabel release];
return image;
}
}