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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:39:22+00:00 2026-06-18T04:39:22+00:00

Possible Duplicate: Making the view slide up to make room for the keyboard? Xcode/iOS5:

  • 0

Possible Duplicate:
Making the view slide up to make room for the keyboard?
Xcode/iOS5: Move UIView up, when keyboard appears

As we normally enter data in textfield keyboard appears and it hides the data what we are entering in fields so is there any way that screen should slide up so that we can see data which is entered in the fiedl.

  • 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-18T04:39:24+00:00Added an answer on June 18, 2026 at 4:39 am

    try this code…….

     -(void)setViewMovedUp:(BOOL)movedUp
     {
     [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.3]; // if you want to slide up the view
    
    CGRect rect = self.view.frame;
    if (movedUp)
    {
        rect.origin.y -= moveKeyboard;
    }
    else
    {
        rect.origin.y += moveKeyboard;
    }
    self.view.frame = rect;
    [UIView commitAnimations];
    }
    
      -(void)keyboardWillShow
     {
    // Animate the current view out of the way
    if (self.view.frame.origin.y >= 0)
    {
        [self setViewMovedUp:YES];
    }
    else if (self.view.frame.origin.y < 0)
    {
        [self setViewMovedUp:NO];
    }
     }
    
    
     -(void)keyboardWillHide
     {
    if (self.view.frame.origin.y >= 0)
    {
        [self setViewMovedUp:YES];
    }
    else if (self.view.frame.origin.y < 0)
    {
        [self setViewMovedUp:NO];
    }
    }
    
    
     - (void)viewWillAppear:(BOOL)animated
     {
    [super viewWillAppear:animated];
    // register for keyboard notifications
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow)
                                                 name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide)
                                                 name:UIKeyboardWillHideNotification object:nil];
     }
     - (void)viewWillDisappear:(BOOL)animated
     {
    [super viewWillDisappear:animated];
    // unregister for keyboard notifications while not visible.
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil];
     }
    

    Edit: moveKeyboard is float. Set its value according to your need.

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

Sidebar

Related Questions

Possible Duplicate: How do you make strings XMLsafe? I am making xml and part
Possible Duplicate: ios making a button change view when text field equals string I
Possible Duplicate: Making the iPhone vibrate How can you programmatically make the iPhone vibrate?
Possible Duplicate: On Screen Keyboard gui is not working I am making a keyboard
Possible Duplicate: What should Linux/Unix 'make install' consist of? I'm making a program that
Possible Duplicate: Making a generic property I'm not quite sure how to do that,
Possible Duplicate: I am making some parts of java image transparent by some code,
Possible Duplicate: CSS Opacity Property I'm making a layer on an image which has
Possible Duplicate: PHP take all combinations I'm thinking of making something in PHP that
Possible Duplicate: Why use getters and setters? Is there any advantage to making methods

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.