How do you set the tab order in iOS?

前端 未结 8 856
星月不相逢
星月不相逢 2020-12-08 18:45

Is there a way (either in IB or code) to set the tab order between text fields in a view?

Note that I\'m not talking about the next form field after the return (or

8条回答
  •  时光取名叫无心
    2020-12-08 19:02

    The Tab key behaviour in ios will be as follows:- when u press tab on external keyboard- the control traverses across all the textfields in that screen by calling only shouldBeginEditing method where its return value is also determined by Apple which cant be override. After scanning all the fields it calculates nearest x positioned Textfield relative to view offset from the current Textfield and then nearest Y Positioned Field.

    Also can't be done anything until control comes to textFieldDidBeginEditing method.

    Reason for apple's restriction might be to let devs to follow the guidelines of UI where next responder of field should be it's closest positioned Field rather than any other field .

提交回复
热议问题