0
UITextField进入UITableViewCell自动重置时向下滚动并返回?
我有更多的UITextField
到UITableViewCell
但是当我向下滚动,我回头UITextField
是空的。有一种不自动重置的方法?
这是代码:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cella"];
if(cell==nil){
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cella"];
}
cell.textLabel.text = [dati objectAtIndex:indexPath.row];
UITextField *testo = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 150, 31)];
testo.borderStyle = UITextBorderStyleRoundedRect;
testo.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
testo.placeholder = @"Inserisci del testo..";
testo.delegate = self;
cell.accessoryView = testo;
return cell;
}
我该怎么做? – user1053839
你会发布你的代码cellForRowAtIndexPath:方法吗? –
当然,我编辑的问题 – user1053839