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 8757659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:21:26+00:00 2026-06-13T14:21:26+00:00

in my view i have 14 text fields in a scrollview. To move the

  • 0

in my view i have 14 text fields in a scrollview.

To move the view up /down while keyboard appears/ disappears i have set the scroll view frame sizes

#pragma mark - Text field view delegate methods
- (void)textFieldDidBeginEditing:(UITextField *)textField; 
{
      //To move the scroll view up to avoid keybord covers the text field
      [UIView beginAnimations:nil context:NULL];
      [UIView setAnimationDelegate:self];
      [UIView setAnimationDuration:0.3];
      [UIView setAnimationBeginsFromCurrentState:YES];
      //scrollView.frame = CGRectMake(scrollView.frame.origin.x, (scrollView.frame.origin.y - 45), scrollView.frame.size.width, scrollView.frame.size.height);


      [scrollView setContentSize:CGSizeMake(200, 1100)];

      [UIView commitAnimations];

}

- (void)textFieldDidEndEditing:(UITextField *)textField;       
{   
      //To move the view down 
      [UIView beginAnimations:nil context:NULL];
      [UIView setAnimationDelegate:self];
      [UIView setAnimationDuration:0.3];
      [UIView setAnimationBeginsFromCurrentState:YES];
       [scrollView setContentSize:CGSizeMake(200, 900)];
      //scrollView.frame = CGRectMake(scrollView.frame.origin.x, (scrollView.frame.origin.y + 45), scrollView.frame.size.width, scrollView.frame.size.height);
      [UIView commitAnimations];

}

for return key board focussed to the next field and for the last field keyboard resign

- (BOOL) textFieldShouldReturn:(UITextField *)textField
{


      if(textField == nameField) {
            [emailText becomeFirstResponder];
      } else if(textField == emailText) {
            [mobileText becomeFirstResponder];
      }
      else if(textField == mobileText) {
            [iPhoneText becomeFirstResponder];
      }
      else if(textField == iPhoneText.value) {
            [companyText becomeFirstResponder];
      }
      else if(textField == companyText) {


       [roleText becomeFirstResponder];
  }

...
......
...........
  else if(textField == lastfield) { // Last fiels
        [textField resignFirstResponder];
  }





      return YES;
}

But my intension is when ever a text field is focussed that text field is moving up to the keyboard top or center of the view

How to do it

  • 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-13T14:21:28+00:00Added an answer on June 13, 2026 at 2:21 pm

    I use TPKeyboardAvoiding for my apps, it seems to work perfectly for me, perhaps give it a try.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a scrollView with some text fields. when the keyboard show, the scroll
I have a scroll view which contains several objects like text fields,labels,switch etc..Now as
I have two text fields in my view. I did it using IB. My
I have the following problem: I got a view with two text fields and
Hii everyone! I have some text fields in each cell of the table view,
I have two text fields in my view. I did it using IB. in
I have a scrollview which contains a text field and a text view. I
I have two text fields in one view. I saved one text field in
I have 8 text fields in the table view. I need to enter the
I have a page with .Net grid view with about 12 text fields per

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.