2011-01-13 68 views

回答

3

@PARTH为了使您的UITableView细胞可编辑的我建议ü给文本框到您的....

例如: - 在

-(UITableViewCell *)reuseTableViewCellWithIdentifier:(NSString *)identifier withIndexPath:(NSIndexPath *)indexPath { 


    CGRect cellRectangle = CGRectMake (0, 10, 300, 70); 
    CGRect Field1Frame = CGRectMake (10, 10, 290, 70); 
    UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:cellRectangle reuseIdentifier:identifier] autorelease]; 
    UITextField *textField; 


    //Initialize Label with tag 1. 

    textField = [[UITextField alloc] initWithFrame:Field1Frame]; 

    textField.tag = 1; 
    [cell.contentView addSubview:textField]; 

[textField release]; 
    return cell; 
} 

并在你的cellForRowAtIndexPath方法//配置单元格。

UITextField *txtTemp = (UITextField *)[cell.contentView viewWithTag:1]; 

使用这个你想在你的tableview相应,否则隐藏它.....希望它会帮助你!

0

你需要把文本字段的表单元格内使用此link.