首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

给UITableViewCell平添UITextField

2012-06-26 
给UITableViewCell添加UITextField?UITextField *textField [[UITextField alloc] initWithFrame: CGRec

给UITableViewCell添加UITextField

?

        UITextField *textField = [[UITextField alloc] initWithFrame: CGRectMake(90, 12, 200, 25)];        textField.clearsOnBeginEditing = NO;//鼠标点上时,不清空        [textField setDelegate: self];        textField.returnKeyType = UIReturnKeyDone;        [textField addTarget:self action:@selector(textfieldDone:) forControlEvents:UIControlEventEditingDidEndOnExit];//把DidEndOnExit事件响应为 textfieldDone: 方法        [cell.contentView addSubview: textField];

?

- (IBAction)textfieldDone:(id)sender {    [sender resignFirstResponder];}
?

?

热点排行