有没有办法仅在一行的删除按钮可见时隐藏 UITableView 的 SectionIndex 栏?
- 滑动行
 - 删除按钮出现,sectionIndex 消失
 - 向后滑动行或按下按钮
 - 删除按钮消失,或者行被删除,sectionIndex 又出现
 
谢谢
有没有办法仅在一行的删除按钮可见时隐藏 UITableView 的 SectionIndex 栏?
谢谢
1)创建带有委托的自定义单元格包含表格视图;
2)使用
- (void)willTransitionToState:(UITableViewCellStateMask)state NS_AVAILABLE_IOS(3_0);
- (void)didTransitionToState:(UITableViewCellStateMask)state NS_AVAILABLE_IOS(3_0); 
用于向委托发送消息以更改状态;
您需要覆盖以下 UITableViewDelegate 方法。这对我很有效:
-(void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath{
    headerHeight = 0.0f;
    NSInteger sectionCount = self.theTableView.numberOfSections;
    NSRange range = NSMakeRange(0, sectionCount);
    [self.theTableView reloadSections:[NSIndexSet indexSetWithIndexesInRange:range] withRowAnimation:UITableViewRowAnimationAutomatic];
}
-(void)tableView:(UITableView *)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath{
    headerHeight = 30.0f;
    NSInteger sectionCount = self.theTableView.numberOfSections;
    NSRange range = NSMakeRange(0, sectionCount);
    [self.theTableView reloadSections:[NSIndexSet indexSetWithIndexesInRange:range] withRowAnimation:UITableViewRowAnimationAutomatic];
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return headerHeight;
}