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.
Related
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.
I have UITextField, UIButton and UIImageView inside my view. On viewDidLoad I am animating (moving up) button and image and setting them on some specific position. But when user taps on a textfield to edit it, as the keyboard appears the button and image move back to their original positions.
I don't want any view to move back after my animation finishes. The keyboard appearance is messing up my views. Why its happening or how can I prevent it from happening?
Newbie alert...
I'm updating some code that has a UITextField with a keyboardType of UIKeyboardTypeNumberPad. In the view, which is in a UIScrollView, there is also a save and cancel button below the textfield. When you tap the textfield, the cancel button is not visible and you cannot scroll to it.
Is there a typical approach for this scenario to make the cancel button accessible when the keyboard pops up?
Is the idea to just manually increase the UIScrollView content size when the keyboard displays and then decrease it when it is dismissed or is there a simpler way of achieving this?
I want to add UITextField and Button as this picture. I think that its position is fixed and It will scroll up when keyboard appeared. I'm wondering it's kind of tableFooterView or what else?
This is a UITextField input accessory view.
It has nothing to do with UITabBar or table view, just a plain old UIView put on top of each and every other view.
When UITextField on the view becomes firstResponder, you should put it over the keyboard and vice a versa.
UITableViewFooter is not an option here - at least look at Facebook or Instagram, it's done differently there.
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