-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath*)indexPath
{
//打开编辑
return YES;
}
- (void)setEditing:(BOOL)eanimated:(BOOL)ani
{
[super setEditing:eanimated:ani];
[mSpecialTableViewsetEditing:e animated:ani];//tableView设置
if (e)self.editButtonItem.title =_(@"done");
elseself.editButtonItem.title =_(@"edit");
}
//tableView 中cell选中事件
- (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
NSInteger specialIndex = [[TQDownListshareInstance]getCurSepcailIndex:indexPath.row];
NSString *strKey = [[TQDownListshareInstance]getCurRowIndex:specialIndex];
TQDownViewSecondPage *taskPage =[[TQDownViewSecondPage alloc]init];
[taskPage setSpecialKey:strKey];
[self.navigationControllerpushViewController:taskPageanimated:YES];
[taskPage release];
}
//编辑tableView 时调整cell view里的控件位置
- (void)layoutSubviews
{
#define REDUCE_LEN 59
int tag = 25;
if(self.editing)
{
//编辑时的位置
} else
{
//默认位置
}
[superlayoutSubviews];
}
四、允许cell之间的拖动
- (BOOL)tableView:(UITableView*)tableView canMoveRowAtIndexPath:(NSIndexPath*)indexPath
{
//允许移动
return YES;
//return NO;
}
- (void)tableView:(UITableView*)tableView moveRowAtIndexPath:(NSIndexPath*)sourceIndexPath toIndexPath:(NSIndexPath*)destinationIndexPath
{
//交换数据
}