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

  • Home
  • SEARCH
  • 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 8979813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:55:58+00:00 2026-06-15T19:55:58+00:00

Maybe this is a recurrent question, but I got stuck with this issue and

  • 0

Maybe this is a recurrent question, but I got stuck with this issue and some iOS concepts. I have a ViewController with a Static Table View, Three Sections and some Rows on Each Section. Inside the rows I have UITextFields. What I’m trying to do is preventing the keyboard to hide my bottom screen UI Text Fields. I’ve just tried an apple solution from Managing the Keyboard, but since I’m not getting the concept behind the scroll view attached to a static table view, I couldn’t implement the idea into my project. Do you guys recommend anyplace to learn it? Sorry if couldn’t explain what I’m trying to do. I’m a little lost.

Any help will be appreciated.

Many thanks,
Marcos.

  • 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-15T19:55:59+00:00Added an answer on June 15, 2026 at 7:55 pm

    I’ve had to do something similar, here’s my code, hopefully it helps you.

    - (void)keyboardWasShown:(NSNotification*)aNotification
    {
        NSDictionary* info = [aNotification userInfo];
        CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
    
        UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0, kbSize.height, 0.0);
        scrollView.contentInset = contentInsets;
        scrollView.scrollIndicatorInsets = contentInsets;
    
        CGRect aRect = self.bounds;
        aRect.size.height -= kbSize.height;
        CGRect activeRect = [activeTextField convertRect:activeTextField.frame toView:self];
    
        if (!CGRectContainsPoint(aRect, activeRect.origin) ) {
            CGPoint scrollPoint = CGPointMake(0.0, activeRect.origin.y-kbSize.height+10);
            [scrollView setContentOffset:scrollPoint animated:YES];
        }
    }
    
    // Called when the UIKeyboardWillHideNotification is sent
    - (void)keyboardWillBeHidden:(NSNotification*)aNotification
    {
        UIEdgeInsets contentInsets = UIEdgeInsetsZero;
        scrollView.contentInset = contentInsets;
        scrollView.scrollIndicatorInsets = contentInsets;
    }
    
    - (void)textFieldDidBeginEditing:(UITextField *)textField
    {
        self.activeTextField = textField;
    }
    
    - (void)textFieldDidEndEditing:(UITextField *)textField
    {
        self.activeTextField = nil;
    }
    
    - (BOOL)textFieldShouldReturn:(UITextField *)textField {
        [textField resignFirstResponder];
        return NO;
    }
    

    Also, make sure to set your notification observers when loading your view, like this:

    [[NSNotificationCenter defaultCenter] addObserver:self
                                                     selector:@selector(keyboardWasShown:)
                                                         name:UIKeyboardWillShowNotification object:nil];
    
    [[NSNotificationCenter defaultCenter] addObserver:self
                                                     selector:@selector(keyboardWillBeHidden:)
                                                         name:UIKeyboardWillHideNotification object:nil];
    

    Just define activeTextField as a UITextField and make sure everything you want to move is contained in your scrollView (in your case you can probably change your viewController to a scrollView). Also, make sure your scrollView’s contentSize is at least self.bounds.size.

    Hope this helps.

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

Sidebar

Related Questions

Maybe this question will look simple but I'm trying to look at some member
Maybe this question should be easy, but it is not. I have read Problem
Maybe this question is kind of silly but I have no clue how to
Maybe this is a stupid question but it's bugging me. I have a bi-directional
maybe this is a stupid question, but i have seen many Tuts that build
Maybe this is a very silly question but I'm new using django. I have
Maybe this is a poor question, but, I can't find a tutorial or even
Maybe this is a dumb question, but do event listeners use CPU cycles like
Maybe this question has been asked many times before, but I never found a
Maybe this is a silly question, but I'm working on a project that wants

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.