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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:27:57+00:00 2026-06-07T19:27:57+00:00

I have set up some text fields and labels to look like a simple

  • 0

I have set up some text fields and labels to look like a simple form which will have to get some user input. My problem is however that whenever some of the text fields are selected and the keyboard slides out, the text fields are covered making it impossible to see the input. My question is how can I move up the text fields so that they stay in view when selected. Maybe someone who is more experienced can help me on this.

  • 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-07T19:27:58+00:00Added an answer on June 7, 2026 at 7:27 pm

    A good solution for this which I like to do is listen to when the textfield begins editing with the following delegate function:

    - (void)textFieldDidBeginEditing:(UITextField *)textField
    {
        //keep a member variable to store where the textField started
        _yPositionStore = textField.frame.origin.y;
    
        //If we begin editing on the text field we need to move it up to make sure we can still
        //see it when the keyboard is visible.
        //
        //I am adding an animation to make this look better
        [UIView beginAnimations:@"Animate Text Field Up" context:nil];
        [UIView setAnimationDuration:.3];
        [UIView setAnimationBeginsFromCurrentState:YES];
    
        commentTextField.frame = CGRectMake(commentTextField.frame.origin.x,
                            160 , //this is just a number to put it above the keyboard
                            commentTextField.frame.size.width,
                            commentTextField.frame.size.height);
    
        [UIView commitAnimations];
    }
    

    and then in this callback you can return it to its original location:

    - (void)textFieldDidEndEditing:(UITextField *)textField
    {
    
        [UIView beginAnimations:@"Animate Text Field Up" context:nil];
        [UIView setAnimationDuration:.3];
        [UIView setAnimationBeginsFromCurrentState:YES];
    
        commentTextField.frame = CGRectMake(commentTextField.frame.origin.x,
                            _yPositionStore ,
                            commentTextField.frame.size.width,
                            commentTextField.frame.size.height);
    
        [UIView commitAnimations];
    }
    

    }

    You will need to declare _yPositionStore as a member variable of CGFloat and have your textFields delegate be set to the view controller that owns it(either using Interface builder and dragging delegate to files owner or setting yourTextField.delegate = self)

    I hope that helps

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

Sidebar

Related Questions

I have a set of input fields, some of them have labels associated, some
I have a Django app with custom form fields, some of which have slow
I have a floated span with some text. I have set the overflow to
I have one AlertDialog which is working fine.I have set some background images to
I have a code which is working fine and displaying some set of values
I have some text fields and a button on my aspx. The text fields
I have a scrollView with some text fields. when the keyboard show, the scroll
hello i have a problem using z-index. i have a form with some input
In my init I have set some variables and one animate that uses those
I have to set some routing rules in my php application, and they should

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.