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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:24:10+00:00 2026-06-04T20:24:10+00:00

I have TextField1 and TextField2 I would like to scroll a scrolling View only

  • 0

I have TextField1 and TextField2
I would like to scroll a scrolling View only when Keyboard is shown due to TextField2.
This is my actual code.
Is there any solution?

-(void) viewWillAppear:(BOOL)animated {    
[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(keyboardDidShow:)
                                             name:UIKeyboardDidShowNotification
                                           object:self.view.window];

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(keyboardDidHide:)
                                             name:UIKeyboardDidHideNotification
                                           object:nil];
}

-(void) keyboardDidShow:(NSNotification *) notification {
   self.ScrollView.center = CGPointMake(self.originalCenter.x,
                                        self.originalCenter.y-100);
}

-(void) keyboardDidHide:(NSNotification *) notification {   
    self.ScrollView.center = CGPointMake(self.originalCenter.x,
                                         self.originalCenter.y);
}
  • 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-04T20:24:12+00:00Added an answer on June 4, 2026 at 8:24 pm

    You’ll need to listen for the UITextfield delegate methods:

    textfield2.delegate = self;
    
    -(void)textFieldDidBeginEditing: (UITextField*)textField {
        if (textField == textField2) {
            //ENABLE THE SCROLLING
        }
    }
    
    -(void)textFieldDidEndEditing: (UITextField*)textField {
        if (textField == textField2) {
            //DISABLE THE SCROLLING
        }
    }
    

    Just customize the methods to your needs.

    If it needs to be exactly when the keyboard shows, you can have a bool to check:

    if (textField == textField2) {
        scrollBool = YES;
        }
    }
    
    -(void)textFieldDidEndEditing: (UITextField*)textField {
        if (textField == textField2) {
            scrollBool = NO;
        }
    }
    
    -(void)keyBoardDidShow.... {
        if (scrollBool) {
            // do the scrolling
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a scroll view that I would like to fill the whole screen,
I have several uitextfields within a view and I would like to disable the
Like seriously after going through this... Easy way to dismiss keyboard? ... I have
I have this situation, where I would like to display a number in figures.
I have an NSTextField that I would like to enable as-you-type spell checking. When
I would like to have a pair of TextFields depending on a value. And
I have some simple UITextFields that bring up the Numberpad. I would like to
I Have an address that I would like to know the coordinates of. For
I have a method like the following in a utility class. I would like
I have this code: <g:form controller=IMI action=action1> <g:textField name=area value=${myValue} /> <br><br> <div id=address></div>

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.