tableHeaderView中UITextField的UITableview - canEditRowAtIndexPath无响应

时间:2012-04-04 10:56:11

标签: iphone uitableview uitextfield

我的UITextfield中有一个tableHeaderView。当我单击导航栏中的编辑按钮时,我可以编辑此文本字段,但无法编辑/移动下面的表格行。

如果我用textField注释掉tableHeaderView,我可以编辑行没有任何问题吗?

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    UITextField *txt = [[UITextField alloc] init];
    txt.text = @"header";
    txt.enabled =TableView.editing;
    return txt;
}

-(IBAction)buttonTap:(id)sender{
    if (TableView.editing) {
        TableView.editing = NO;
    }else TableView.editing = YES;
    [TableView reloadData];
}
相关问题