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
4

1 回答 1

0

为了获得 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;
    }
}

这适用于我的用例。

于 2013-10-04T14:57:19.313 回答