Note that there are some explanatory texts on larger screens.

plurals
  1. POScroll to a cell in a TableView inside a Popover
    primarykey
    data
    text
    <p>I have a tableView with a fixed number of rows (7). Each row consist of a label + a textField.</p> <p>When a textfiled is touched the virtual keybord is presented, that causes the popover to get resized and with the new size only 4 of the 7 rows are visible. What i want to do is that everytime the user touches a new textfield the tableview scrolls to the cell containing it.</p> <p>Ive tried </p> <pre><code>- (void)textFieldDidBeginEditing:(UITextField *)textField{ CGPoint point = [textField.superview convertPoint:textField.frame.origin toView:self.tableView]; NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:point]; NSLog(@"Row %d section %d", indexPath.row, indexPath.section); [tableView reloadData]; [tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:NO]; } </code></pre> <p>and also</p> <pre><code>- (void)textFieldDidBeginEditing:(UITextField *)textField{ CGPoint point = [textField.superview convertPoint:textField.frame.origin toView:self.tableView]; CGPoint contentOffset = tableView.contentOffset; contentOffset.y += (point.y - self.navigationController.navigationBar.frame.size.height); // Adjust this value as you need [tableView setContentOffset:contentOffset animated:YES]; } </code></pre> <p>But none of them works. The method is being called (I have the delegate set up). Im pretty sure its not working due to the resizing caused by the virtual keyboard, but I don´t know who could I solved it.</p> <p>Any help? Thanks a lot</p>
    singulars
    1. This table or related slice is empty.
    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.
    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