Note that there are some explanatory texts on larger screens.

plurals
  1. POTwo Textfield in uitableview issue
    primarykey
    data
    text
    <p>I have a uitableview with <strong>2 rows n 4 sections</strong> and i have a <strong>label and textfield in each cells</strong>. And the problems is my label comes in all section where as my textfield is not repeating in other sections. Actually i have two textfield one for each cell, one is normal textfield and another is picker textfield (when I clicked TF the picker will pop up). <strong>For one section both the TF coming but it's not repeating in other section</strong>. </p> <p>My code</p> <pre><code>static NSString *CellIdentifier = @"Cell"; UITextField *textField; NSString *string=[NSString stringWithFormat:@"ident_%d",indexPath.row]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:string]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } cell.selectionStyle=UITableViewCellSelectionStyleNone; UILabel *lbl1 = [[UILabel alloc]initWithFrame:CGRectMake(50, 10, 100, 35)]; [lbl1 setFont:[UIFont systemFontOfSize:16]]; [lbl1 setTextColor:[UIColor blackColor]]; [lbl1 setBackgroundColor:[UIColor clearColor]]; if (indexPath.row==0) { lbl1.text = @"Quantity"; [cell.contentView addSubview:self.qntTF]; } if (indexPath.row==1) { lbl1.text = @"Unit"; [cell.contentView addSubview:self.unitTF]; } // Configure the cell...; textField =[self.tableArray objectAtIndex:indexPath.row]; [cell.contentView addSubview:textField]; cell.textLabel.text = nil; textField.tag = TextFieldTag; cell.detailTextLabel.text = nil; [cell addSubview:lbl1]; [lbl1 release]; return cell; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload