Detect Focus Change for UITextField

后端 未结 4 1826
臣服心动
臣服心动 2021-02-01 02:20

I\'m trying to set the animation for the view to move up when keyboard is hiding and appearing for the text fields and I got it to work perfectly fine, but when the focus moves

4条回答
  •  無奈伤痛
    2021-02-01 02:32

    -(BOOL)textFieldShouldBeginEditing:(UITextField*)textField {
    if (textField.tag == 1) { //first textField tag
        //textField 1
    }
    else {
       //textField 2
    }
    }
    

提交回复
热议问题