Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8114495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:09:44+00:00 2026-06-06T03:09:44+00:00

I have problem with a long form in iOS. The form itself is done

  • 0

I have problem with a long form in iOS. The form itself is done with a static table view. For the form I needed a toolbar with prev/next and done. In this project I added BSKeyboardControls, and I’ve allready done it myself in another project.

The toolbar works fine except when the next or previous textField/textView is out of sight. Then the focus on the former textField won’t change and I’m still typing in this text field. When I now scroll manually and the targeted next textfield appears it magically becomes the first responder. This is of course not the expected behabier.

So I figured out I would have to scroll the table view to the respective fields before trying to set them as first responder. But I connot get this done.

I’ve tried to this with indexPathes

NSIndexPath *path = [self.tableView indexPathForCell:(UITableViewCell *)textField.superview.superview];
[self.tableView scrollToRowAtIndexPat:path atScrollPosition:UITableViewScrollPositionTop animated:YES];

Although the super-superview is a valid (and the right) table cell, the path returned is nil. I also tried some variations

CGPoint point = [self.tableView convertPoint:textField.frame.origin toView:self.tableView];
NSIndexPath *path = [self.tableView indexPathForRowAtPoint:point];

and other variations with rects and indexPathsForRowsInRect.

The only way is to manually keep track of the textFields cell indexPaths, but that is no suitable solution in this case.

Anybody has an idea of how to achieve scrolling to an out of sight textField in a tableView?

Edit:

As Justin Paulson requested the code of keyboardControlsPreviousNextPressed:

- (void)keyboardControlsPreviousNextPressed:(BSKeyboardControls *)controls withDirection:(KeyboardControlsDirection)direction andActiveTextField:(id)textField
{
    NSIndexPath *path = [self.tableView indexPathForCell:(UITableViewCell *)((UIView *)textField).superview.superview];
    NSLog(@"path %@ for cell %@", path, ((UIView *)textField).superview.superview);
    [self.tableView scrollToRowAtIndexPath:path atScrollPosition:UITableViewScrollPositionTop animated:YES];
    [textField becomeFirstResponder];
}

As I said according to the output of the log the path is nil, whereas the super-superview is the rught table view cell

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:09:45+00:00Added an answer on June 6, 2026 at 3:09 am

    Thanks for trying to help me, i’ve a solution myself. In my keyboardControlsPreviousNextPressed i have now

    [self.tableView scrollRectToVisible:((UIView *)textField).superview.superview.frame animated:YES];
    [textField becomeFirstResponder];
    

    This solution seems to work quite well. The only problem i’ve encountered is that sometimes the newly focused textField is hidden by the keyboard, so the tableViewController doesn’t adjusts itself automatically. You could additionally scroll the row to the top to circumvent this in most cases.

    NSIndexPath *path = [self.tableView indexPathForCell:(UITableViewCell *)textField.superview.superview];
    [self.tableView scrollToRowAtIndexPath:path atScrollPosition:UITableViewScrollPositionTop animated:YES];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to solve this problem for a long time. I have 2 forms,
I have a long string, ex: Please help me to solve this problem. This
Here's the use case: I have this long form with group of field that
I have a problem with long urls in the context of video streaming via
I have a problem for a long time, I don't figure out where the
I have been using Java for a very long time and I have problem
I have a problem with a page that's taking a long time to refresh
I have a long standing problem: at work we're using mercurial as a DSCM,
My problem is simple: I have a long list of elements that I want
My problem is the following: I have a 2-minute long WAV file, and my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.