0

What is the best way to have a UIToolbar with a UITextField appear above the keyboard ?

In particular, I'm looking for a way to implement this in iOS 6.

The basic functionality I am trying to achieve is similar to iOS SMS app except the keyboard would appear by default.

Thanks.

Mayur Prajapati
  • 5,454
  • 7
  • 41
  • 70
user2312407
  • 67
  • 1
  • 11

1 Answers1

3

Either adding a toolbar to your storyboard and add an outlet to it, or add the toolbar to a xib file then use InputAccessoryView of text field you want to add the toolbar to it e.g.

[[NSBundle mainBundle] loadNibNamed:@"KeyboardToolbar" owner:self options:nil];
[textField setInputAccessoryView:keyboardToolbar];

enter image description here

Mahmoud Adam
  • 5,772
  • 5
  • 41
  • 62