i am experiencing some weird problems with my UITableView.
I have a Grouped TableView with 1 row per section. There is a Textfield in each row.
When i am not forced to scroll, everything is displayed correct.
But if i have to scroll, the previously hidden cells are messed up. they do contain a textfield, but there are many text labels laying over each other.
Cell http://dcsl.info/b/Untitled.png
Any advice?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
if(indexPath.section < [sectionArray count]) {
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(20, 10,580, 31)];
textField.tag = indexPath.section + 22;
textField.autocorrectionType = UITextAutocorrectionTypeNo;
textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
textField.delegate = self;
textField.text = [item.rechnerValues objectAtIndex:indexPath.section+1];
[cell.contentView addSubview:textField];
}
return cell;
}
1 Answer