Reputation: 11
This is my custom design
I am trying to implement 2 simple UITableView
. 1st UITableView
covers top half of the screen and 2nd UITableView
covers the bottom half of the screen. Each cell in the UITableView
has an embedded UITextField. Whenever I select one of the (2nd UITableView) bottom text boxes, The Keyboard slides up, but the UITableView
does not scroll, and the keyboard hides the input fields and 2nd UITableView
too.
Suggest me what to do in this scenario. I am only using 2 UITableView
.
For reference please find below links to the images:
Upvotes: 0
Views: 5098
Reputation: 1874
PLease use IQKeyboardManager this will automatically Adjust the Scrolling Enough you have to put this code in your AppDelegate:-
import IQKeyboardManagerSwift
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
IQKeyboardManager.shared.enable = true
return true
}
Upvotes: 0
Reputation: 28750
You need to use one UITableView
and use TPKeyboardAvoidingTableView
class for your UITableView
this class automatically manages scrolling of UITextFields
inside UITableViewCells
. You will get the sample code search on google for TPKeyboardAvoidingTableView
.
Upvotes: 1
Reputation: 906
change the height of the tableview when the keyboard is shown and then when it is dismissed reset the height. Hope this answers you question.
Upvotes: 0
Reputation: 7644
There are answers available on stackoverflow related to your problem. Try this one: iPhone - Keyboard hides TextField
Upvotes: 0