- Home /
How to focus inputfields while click on 'Tab' button
Hi, I want focus input fields using tab button. I have found some code for focusing input fields but that one not satisfied my requirement. In my application one page design like number of input field in both horizontal and vertical formate. In my page have 3 rows of input field and each row have 3 input fields. my requirement is when user click on tab button focus next input field it's working but when reach end of the row, how can I focus next row contain input field. Please suggest any idea. Thank you. You can find my sample page design in below.
Here is the code I have tried.
Selectable next =
system.currentSelectedGameObject.GetComponent<Selectable().FindSelectableOnRight();
if (next != null)
{
InputField inputfield = next.GetComponent<InputField>();
if (inputfield != null)
{
inputfield.OnPointerClick(new PointerEventData(system));
system.SetSelectedGameObject(next.gameObject, new BaseEventData(system));
}
![alt text][1]}
[1]: /storage/temp/119502-screen-shot-2018-06-25-at-95906-am.png
Your answer
Follow this Question
Related Questions
Sneak in UIView 1 Answer
Buttons in unity: Text or Built in text in PNG? 2 Answers
UIView as subclass of Unity's UIWindow 0 Answers
Scroll View Null Reference error 0 Answers
Implemeting third-party ios plugin to unity problems 0 Answers