iPhone Force Textbox Input to Upper Case

前端 未结 11 1635
无人共我
无人共我 2020-12-15 03:01

How do I force characters input into a textbox on the iPhone to upper case?

11条回答
  •  我在风中等你
    2020-12-15 03:37

    The simplest way would be to , implement the editing changed method of the text field and set the textfield's text value to upper case representation of the entered text

    - (IBAction)TextFieldEditingChanged:(id)sender
    {
        _yourTextField.text = [_yourTextField.text uppercaseString];
    }
    

提交回复
热议问题