0

How would I change the text on the search bar induced keyboard from "search" to "cancel" or "done"

I can change the keyboard type:

((UISearchBar)TableView.TableHeaderView).KeyboardType = UIKeyboardType.CHOICE
MikroDel
  • 6,705
  • 7
  • 39
  • 74
WickedW
  • 2,331
  • 4
  • 24
  • 54

1 Answers1

0

In order to get at the ReturnKeyType -

foreach (UIView subView in ((UISearchBar)TableView.TableHeaderView).Subviews)
{
    var view = subView as IUITextInputTraits;
    if (view != null)
    {
        view.KeyboardAppearance = UIKeyboardAppearance.Default;
        view.ReturnKeyType = UIReturnKeyType.Done;
    }
}

This work for my use case.

WickedW
  • 2,331
  • 4
  • 24
  • 54