1

Common ux case on mobile is to have the view magically scrolling when keyboard shows up so that input field remains visible above keyboard

Mobile sdks like Xamarin, ios or android would provide that functionality natively.

Would there be such command in Unity?

I could consider a default position and make the canvas/scroll view move accordingly but maybe there is already something.

2 Answers 2

1

As far as I know, this behavior is not native in Unity at all.

You can use TouchScreenKeyboard.visible to detect if the keyboard is on screen and modify your UX as necessary yourself, though.

The docs on the TouchScreenKeyboard class says:

TouchScreenKeyboard.visible and TouchScreenKeyboard.area should be used to determine if the keyboard is being shown (activated) and what portion of the screen is using.

5
  • As i thought. I was just trying my luck. I guess i'll figure out smg. Thanks.
    – Everts
    Jan 10, 2018 at 21:29
  • So after a bit of research, first the TouchScreenKeyboard.area returns rect 0 on Android which is not going to make things easier...So as I have no way to know the area occupied by the keyboard, this makes it quite impossible.
    – Everts
    Jan 11, 2018 at 7:53
  • @Everts I haven't messed with it before myself. I've not made an app where it's come up. Jan 11, 2018 at 16:44
  • No worries, i was just updating on my attempt to find a solutio using your tips. And first result on Android is not so promissing.
    – Everts
    Jan 11, 2018 at 18:22
  • @Everts Mess around with it, you'll either find another question or a better answer. :) Jan 11, 2018 at 18:24
0

So I ended up finding this one

https://forum.unity.com/threads/move-ui-above-touchkeyboard-for-mobile.353493/

I have not tried the code but this is as close to a solution.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.