ios - UIKeyboardFrameBeginUserInfoKey & UIKeyboardFrameEndUserInfoKey -
in managing keyboard documentation:
uikeyboardframebeginuserinfokey key nsvalue object containing cgrect identifies start frame of keyboard in screen coordinates. these coordinates not take account rotation factors applied window’s contents result of interface orientation changes. thus, may need convert rectangle window coordinates (using convertrect:fromwindow: method) or view coordinates (using convertrect:fromview: method) before using it.
uikeyboardframeenduserinfokey key nsvalue object containing cgrect identifies end frame of keyboard in screen coordinates. these coordinates not take account rotation factors applied window’s contents result of interface orientation changes. thus, may need convert rectangle window coordinates (using convertrect:fromwindow: method) or view coordinates (using convertrect:fromview: method) before using it.
what meaning of start frame
, end frame
? difference between them?
the start frame keyboard @ beginning of animation: offscreen if keyboard being shown, or onscreen if keyboard being hidden. end frame keyboard @ end of animation: vice versa. can use difference between them write single method responds both hiding , showing keyboard.
be sure use uikeyboardanimationcurveuserinfokey
, uikeyboardanimationdurationuserinfokey
when animating view changes: way, animations , os's animations in sync.
another hint: documentation linked states, "the rectangle contained in uikeyboardframebeginuserinfokey , uikeyboardframeenduserinfokey properties of userinfo dictionary should used size information contains. not use origin of rectangle (which {0.0, 0.0}) in rectangle-intersection operations". @ least on ipad on os 3.2, not true. both rects have same size, while origin, in screen coordinates, differs between two.
you may find question helpful: uikeyboardboundsuserinfokey deprecated, use instead?
Comments
Post a Comment