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
Related
I am building a chat application and I have a UIViewController that contains a UITableView. I have a custom view that contains an autoexpanding UITextView and used it to override the inputAccessoryView in my view controller. The tableview has keyboardDismissMode as interactive. When I am trying to drag the keyboard up/down, I want to get the event so I can either update my tableview's bottom constraint or update my tableview's content inset. The notifications for keyboardWillShowNotification nad keyboardWillHideNotification only gives me the notification when the keyboard has finished showing and hiding. I need something that can notify me while the user is dragging the keyboard up/down. Just like how WhatsApp have in their chat screen.
By default, if you set a UITextField keyboard type to Number Pad when it is displayed, it appears on the bottom of the screen. My problem is, if the controller has a toolbar, they can not appear when the keyboard appears. I want the number pad to appear on above toolbar. Can I change the position of it?
Any ideas?
first
second
No, you're not able to change the position of the system keyboard. You can however put the toolbar on top of the keyboard. There is a property on UIKeyboard that allows this. Look at inputAccessoryView.
You should listen for the various keyboard events, such as UIKeyboardWillShowNotification and adjust the constraints/frame of your toolbar accordingly. This will allow you to place your toolbar wherever you want when the keyboard is shown and dismissed.
Reference: https://developer.apple.com/library/content/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html
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 an iOS8 app which has a UITabBarViewController as part of its master view. Embedded within that is a UITableViewController which has some UITextFields embedded in some of the cells.
When a text view is tapped, the keyboard automatically appears. If necessary, the 'view' is adjusted to allow the textView to remain showing so data can be entered.
The problem is that the tabBarController and associated tabs are also moved up. This is usually OK unless my phone is in landscape which leaves very little room to show the tableview and allow effective gestures (e.g. swiping the tableview up/down).
So, is there a way to get the keyboard to only push-up the tableview within the tabBarController, rather than the whole outer frame also being moved up? Picture below shows the problem. The device is in landscape
I have created a table view controller sort of a master-detail approach, when I click on the master view the detail view would come out with a textfield at the bottom of the screen contained within a view on a toolbar.
My question is how can I automatically adjust the position of the toolbar when the keyboard pops-out when I clicked on the textfield, currently when I enter on the textfield the keyboard comes out covering my textfield.
If you want to avoid the keyboard covers your textfield check this question and answers
iPhone Keyboard Covers UITextField
If you have more than a textfield, consider using a scrollview and move up when the keyboard appears.