How to prevent keyboard from dismissing when device rotates? - ios

I have an iPhone app that has a "contact picker" using a table view. If my "recipient" field is active and the keyboard is shown, then the device is rotated, the keyboard dismisses itself automatically.
How can I disable this functionality?

Turns out, my TokenView was reloading on rotation and not re-setting the firstResponder to it's textView, which caused the keyboard to hide.
Fixed the issue by adding a line to set the first responder to the TokenView's UITextView in it's 'reloadData' function.

Related

Accessibility voiceover hides keyboard when swiping through long tableview

I am trying to fix a bug where voiceover in accessibility is dismissing the keyboard when I am trying to search through a long tableview. Is there a way to jump directly to the keyboard when the keyboard shows up?

Keyboard does not dismiss interactively

On an iOS app, I have the following view structure:
UIViewController > UIView > UIScrollView > UITextView
The UIScrollView has the "Dismiss Interactively" setting. When I tap on the UITextView, the keyboard pops-up properly. However I now try to gradually dismiss the keyboard by slowly swiping my finger down, but nothing happens.
Did I forget anything in my configuration ?
Example project
Since iOS 7, you can use
scrollView.keyboardDismissMode = .Interactive
The keyboard follows the dragging touch offscreen and can be pulled upward again to cancel the dismiss.
Issue was linked to the fact that the scrollView contents were shorter than the screen size.

How to get keyboard height in viewDidLoad not after keyboard opens

I want to set a view frame to be above the keyboard.
That it will not need to change height/location after keyboard appears.
Is there a way to get keyboard height in ViewDidLoad and not after keyboard appears?
Thanks
with and without keyboard the view should always be in the same place.
There are fixed sizes for Keyboard heights in iOS.
Here's some documentation that would help you.
http://www.idev101.com/code/User_Interface/sizes.html
You can just check what device is being using and find its keyboard height accordingly.

Textfield text goes down ios 7

I have create on subclass of UITextField to customaize textfield.
My textfield text is proper when I started typung text. On shaking phone I am presenting one viewcontroller. When I present that controller via shaking and then after dismissing text goes down insdie the textfield. See attached screenshot.
Try logging textfield frame before and after shaking of your phone, may be autoresizing of text field changes its frame.

Keyboard overlapping TextField in landscape orientation

Enter Account Number and Enter Branch Id Textfields are working well at portrait mode when keyboard is appearing.I dissmiss it in Verify button as i don't get return key at Number pad.i do it programmatically.
But in landscape mode the keyboard is hidding my TextFields.What to do now?Any help is a blessing.
This is a common problem, you can easily manage also. If the text fields are within the table view you can scroll the table view when the keyboard appears, if not you should embed the all the controls within a scroll view and scroll it. Use the keyboard notification to detect keyboard appearance and dismissal.
Basically, you register to receive the UIKeyboardWillShowNotification and the UIKeyboardWillHideNotification, then you manually scroll the view to compensate.
pls refer this link
Making a UITableView scroll when text field is selected

Resources