iPhone UISearchBar & keyboardAppearance

后端 未结 4 1957
说谎
说谎 2020-12-30 11:07

When the keyboard appears, I want to set the

keyboardAppearance = UIKeyboardAppearanceAlert

I\'ve checked the documentation and it looks l

4条回答
  •  再見小時候
    2020-12-30 11:27

    keyboardAppearance is a property of the UITextInputTraitsProtocol, which means that the property is set via the TextField object. I'm not aware of what an Alert Keyboard is, from the SDK it's a keyboard suitable for an alert.

    here's how you access the property:

    UITextField *myTextField = [[UITextField alloc] init];
    myTextField.keyboardAppearance = UIKeyboardAppearanceAlert;
    

    Now when the user taps the text field and the keyboard shows up, it should be what you want.

提交回复
热议问题