How can I programmatically assign focus to a specific UITextField in a view? I have several fields and on view display, I'd like to put the cursor on a specific field, not the first one at top.



Try doing this in viewWillAppear:

[desiredField becomeFirstResponder];

By making the field the first responder, it have focus and the keyboard will be displayed.

THE END !

相关文章:

  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-07-02
  • 2021-06-24
猜你喜欢
  • 2022-12-23
  • 2021-09-08
  • 2022-03-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
相关资源
相似解决方案