I built a registration form for a mobile game using Unity 5.1. To do that, I use Unity UI components: ScrollRect + Autolayout (Vertical layout) + Text (labels) + Input Field. This part works fine.
But, when keyboard is opened, the selected field is under keyboard. Is there a way to programmatically scroll the form to bring the selected field into view?
I have tried using ScrollRect.verticalNormalizedPosition
and it works fine to scroll some, however I am not able to make selected field appear where I want.
Thanks for your help !
Yes,this is possible using coding to scroll vertically, please try this code :
This code working fine for me ,when i developed chat functionality.
I am going to give you a code snippet of mine because i feel like being helpful. Hope this helps!
here's the way I clamped selected object into ScrollRect
None of the suggestions worked for me, the following code did
Here is the extension
And here is how I used it to scroll a direct child of the content into view