我想给在tableviewcell文本框我writen一些代码,我可以看到细胞文本框,但是当我去下一个单元格,然后我的价值是即消失,以及如何给细胞键盘即消失,请检查这个代码,我对细胞writen,请帮我如何从细胞即消失键盘。如何给细胞文本框在iphone
我想给文本框不仅在一排在所有行。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
}
if ([indexPath row] == 0 && [indexPath section] == 0)
{
[email protected]"Tags";
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 185, 30)];
cell.accessoryView = textField;
}
if ([indexPath row] == 1 && [indexPath section] == 0)
{
[email protected]"Notes";
cell.detailTextLabel.text=app.Notes;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
}