How to change the keyboard toolbar wording?

40 views
Skip to first unread message

pulkitsinghal

unread,
May 10, 2012, 10:09:38 PM5/10/12
to ibaf...@googlegroups.com
I recently realized that it was simpler to have the save/cancel/done buttons in the UINavigation rather than:
a) as part of the form, or
b) hooked-up to the done button of the keyboard-toolbar,
c) hooked-up to the keyboard-enter key etc.

Now I want to edit the keyboard-toolbar's wording from "Done" to "Dismiss" in order to relay a consistent message to the users.

Could you enlighten me on how to do that?


pulkitsinghal

unread,
May 10, 2012, 10:38:30 PM5/10/12
to ibaf...@googlegroups.com
Figured out that since its not possible to change the text, its better to wire up a new button the same way as the older one inside the custom datasource's initWithModel method:

#pragma mark - NSObject methods
- (id) initWithModel : (id)model
{
    if ((self = [super initWithModel:model]))
    {
        [IBAInputManager sharedIBAInputManager].inputNavigationToolbar.doneButton =
        [[UIBarButtonItem alloc] initWithTitle:@"Dismiss"
                                         style:UIBarButtonItemStyleDone
                                        target:[IBAInputManager sharedIBAInputManager]
                                        action:@selector(deactivateActiveInputRequestor)];
...

Let me know if this has repercussions that I cannot yet foresee.

Jesse Collis

unread,
May 10, 2012, 10:14:12 PM5/10/12
to ibaf...@googlegroups.com
The button is the system DONE button, you can't change the text without replacing it all together with a different button. 

IBAInputNavigationToolbar.m line 48

doneButton_ = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone 
  target:nil 
  action:nil];

-JC 
signature0.png
Reply all
Reply to author
Forward
0 new messages