在我的iPhone应用程序中,我有一个表格视图。如何使iPhone SDK中的触摸可编辑tableviewcell文本?
我希望当用户选择(或基本触摸)tableview的单元格时,他/她应该能够编辑单元格内容。
我该怎么做?
在我的iPhone应用程序中,我有一个表格视图。如何使iPhone SDK中的触摸可编辑tableviewcell文本?
我希望当用户选择(或基本触摸)tableview的单元格时,他/她应该能够编辑单元格内容。
我该怎么做?
@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相应,否则隐藏它.....希望它会帮助你!
你需要把文本字段的表单元格内使用此link.