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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:50:13+00:00 2026-06-14T21:50:13+00:00

I need someone to explain this to me as it is not making any

  • 0

I need someone to explain this to me as it is not making any sense.

When getting the UIKeyboards frame from the userInfo using UIKeyboardFrameEndUserInfoKey and doing the math so that a view would appear to be stacked on top of the keyboard, I need to make a difference of 20 pixels.

The math:

CGRect frame = view.frame;
CGPoint origin = frame.origin;
origin.x = kbFrame.origin.x;
origin.y = kbFrame.origin.y - view.frame.size.height - 20;
frame.origin = origin;
view.frame = frame;

I thought it must be the status bar, but here’s the kicker, I’m developing on a retina display and so the status bar is 40 pixels in height not 20.

I then added a the conversion from view to view

CGRect kbFrame = [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];

UIWindow * window = [UIApplication sharedApplication].windows[0];

kbFrame = [self.view convertRect:kbFrame fromView:window];

and that seems to fixed of it; that is I can remove the 20 pixels difference.

What really throws me is when using UIKeyboardFrameBeginUserInfoKey, the keyboard’s frame is at the bottom of the screen, which is correct, but the end frame causes me to encode a 20 pixel difference. When I add the conversion code in, it puts the keyboard 20 pixels up and so gets rid of the difference. What the hell is going on?

  • 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-14T21:50:15+00:00Added an answer on June 14, 2026 at 9:50 pm

    The thing you are describing is the natural and wanted behaviour.
    The thing is that the keyboard coordinate are in the Window Coordinate system.
    Your view is probably not in Window Coordinate system. So you always need to do a conversion between coordinate system to be able to use it correctly.

    What really throws me is when using UIKeyboardFrameBeginUserInfoKey, the keyboard’s frame is at the bottom of the screen, which is correct,

    I would disagree, you are probably 20 points lower than what you think you are (if you are setting it in your View coordinate system), but since that is off the screen you don’t notice the offset.

    Every View have it’s own coordinate system that is inside it’s bounds. And the frame of a view is expressed in it’s parent coordinate system. That can also lead to some confusion if we don’t understand the why and necessity of this difference.

    I hope this will help you.

    NOTE on Retina Display and Measurement :
    On iOS you never deal with Pixel in your code (only when preparing your assets) you always deal with Point. So the Status bar is always 20 points, on Retina or not.

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

Sidebar

Related Questions

I don't understand why this does not work. Can someone explain what I need
I need someone to explain to me where this extra padding is coming from
Can someone please explain me why would a UDP Server not need to use
Please i need someone to help convert this query entity(c#) form. select * from
OK, i need someone to explain to me where to start on this project.
I am not too familiar with javascript. Can someone please explain this construct to
I need someone to explain the following names; Asynchronous Delegates. Asynchronous methods. Asynchronous events.
I don't understand the need for self-joins. Can someone please explain them to me?
Mabye someone over here can explain to me what am I doing wrong. This
Could someone explain this to me? var diagramImage = new Kinetic.Shape(function () { var

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.