Closed shawn458 closed 8 years ago
I am having a problem where the AutoCompleteTextField table is covered up by other cells in my UITableView.
I am dynamically building the field in my cellForRowAtIndexPath method.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier; if (indexPath.row == 1) { CellIdentifier = @"AutoCompleteCell"; AutoCompleteTextFieldTableViewCell *cell = (AutoCompleteTextFieldTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[AutoCompleteTextFieldTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } cell.label.text = self.cellTitles[indexPath.row]; cell.textfield.delegate = self; cell.textfield.autoCompleteDataSource = self; cell.textfield.autoCompleteDelegate = self; [cell.textfield setAutoCompleteTableAppearsAsKeyboardAccessory:NO]; NSString *key = cell.label.text; if ([self.dictOfLabelsAndTexts valueForKey:key] != nil) { cell.textfield.text = [self.dictOfLabelsAndTexts valueForKey:key]; } else { cell.textfield.text = @""; } return cell; } else { CellIdentifier = @"Cell"; TextFieldTableViewCell *cell = (TextFieldTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[TextFieldTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } cell.label.text = self.cellTitles[indexPath.row]; cell.textfield.delegate = self; NSString *key = cell.label.text; if ([self.dictOfLabelsAndTexts valueForKey:key] != nil) { cell.textfield.text = [self.dictOfLabelsAndTexts valueForKey:key]; } else { cell.textfield.text = @""; } return cell; } }
Is this not possible?
This has been resolved. I added a view to my uitableview's header and placed the textfield inside of there.
I am having a problem where the AutoCompleteTextField table is covered up by other cells in my UITableView.
I am dynamically building the field in my cellForRowAtIndexPath method.
Is this not possible?