0

I hope to push keyboard with button list on the top of the keyboard. Please refer to the image

enter image description here

Is it possible?

swiftBoy
  • 35,607
  • 26
  • 136
  • 135
arachide
  • 8,006
  • 18
  • 71
  • 134

2 Answers2

1

you need to add a toolbar. Here is an example I used for an action sheet - you can make the modifications for the keyboard easily:

  //DEFINING TOOL BAR 
UIToolbar * keyboardToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
keyboardToolbar.barStyle = UIBarStyleBlackOpaque;
[keyboardToolbar sizeToFit];    
NSMutableArray *barItems = [[NSMutableArray alloc] init];
UIBarButtonItem *flexSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
[barItems addObject:flexSpace];
UIBarButtonItem *doneBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismissKeyboard:)];
[barItems addObject:doneBtn];
[keyboardToolbar setItems:barItems animated:YES];
[keyboard addSubview:keyboardToolbar]; 

You can obviously add more items to the UIToolBar for "Next", "Previous", etc.

TommyG
  • 4,145
  • 10
  • 42
  • 66
0

It is possible. Here is a link to a keyboard controls project on github.

Marco
  • 6,692
  • 2
  • 27
  • 38