Display keyboard without animation

后端 未结 7 1474
感情败类
感情败类 2020-11-29 03:12

Looked intoUIKeyboardAnimationDurationUserInfoKey but I just can\'t find anywhere how to set it to a custom value.

相关标签:
7条回答
  • 2020-11-29 03:48

    I've found the best solution is using UIView.setAnimationsEnabled(_ enabled: Bool).

    Swift 3

    UIView.setAnimationsEnabled(false)
    textField.becomeFirstResponder()
    // or textField.resignFirstResponder() if you want to dismiss the keyboard
    UIView.setAnimationsEnabled(true)
    
    0 讨论(0)
提交回复
热议问题