Is it possible to get the frame, actually its height, of the keyboard dynamically? As I have a UITextView
and I would like to adjust its height according to the keyboard frame height, when the input method of the keyboard is changed. As you know, different input methods may have different keyboard frame height.
In the proper position, the keyboard should be placed just above the level of your lap. This is lower than most people normally place their keyboard, but lets your arms tilt downward while using the keyboard, leaving your elbows at a comfortable "open" angle.
To configure the size of the keyboard, you need to open the SwiftKey app, then tap “Layout & keys”. Tap “Layout & keys” in the SwiftKey app to get to the keyboard resizing settings. Once in the layout and keys menu, tap the top option “Resize”, to configure the size of your keyboard.
The universal height of the letters view on iPhone is of 216 points in portrait and 162 points in landscape. On iPad it's 264 points in portrait and 352 points in landscape (these heights don't include top the number row).
Via Tap Gesture This is the quickest way to implement keyboard dismissal. Just set a Tap gesture on the main View and hook that gesture with a function which calls view. endEditing .
try this:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil]; - (void)keyboardWasShown:(NSNotification *)notification { // Get the size of the keyboard. CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; //Given size may not account for screen rotation int height = MIN(keyboardSize.height,keyboardSize.width); int width = MAX(keyboardSize.height,keyboardSize.width); //your other code here.......... }
Tutorial for more information
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With