Reputation: 108
User needs to fill form data on screen and it is a long one. For these purpose i need to add panel on top of keyboard How can i present it in via code and different set of buttons for ios 7
UIToolbar * keyboardToolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
keyboardToolBar.barStyle = UIBarStyleDefault;
[keyboardToolBar setItems: [NSArray arrayWithObjects:
[[UIBarButtonItem alloc]initWithTitle:@"Previous" style:UIBarButtonItemStyleBordered target:self action:@selector(previousTextField)],
[[UIBarButtonItem alloc] initWithTitle:@"Next" style:UIBarButtonItemStyleBordered target:self action:@selector(nextTextField)],
[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil],
[[UIBarButtonItem alloc]initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self action:@selector(resignKeyboard)],
nil]];
textField.inputAccessoryView = keyboardToolBar;
Upvotes: 2
Views: 1120
Reputation: 7474
Use this control
https://github.com/simonbs/BSKeyboardControls
It is currently supporting ios 5+ onwards It presents different UI for ios 7 as well
Upvotes: 3