UITextField no longer reloads keyboardType after reloadInputViews call

前端 未结 2 2245
太阳男子
太阳男子 2021-02-20 12:14

In iOS 7, I could change the keyboard type while it is the firstResponder (on the fly):

if (textField.text.length > 2) {

    textField.keyboardT         


        
2条回答
  •  情歌与酒
    2021-02-20 12:38

    I found that this works when the textfield is first responder:

    [self.textField reloadInputViews];
    [self.textField setText:@" "];
    [self.textField setText:@""];
    

提交回复
热议问题