2011-01-13 77 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.