What is the best way to scroll form when keyboard opens?

Home Forums Books Unity 3D UI Essentials What is the best way to scroll form when keyboard opens?

This topic contains 1 reply, has 2 voices, and was last updated by  Simon (darkside) Jackson 3 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7375

    Karl Shifflett

    Our app has many forms, some with 5-8 InputFields.

    What is the best way to manage scrolling the form up or down in response to the keyboard opening or closing?

    Given that Unity controls the opening and closing of the keyboard, is there a way to know when the keyboard has been displayed?

    Thank you very much in advance!!

    Karl

    #7383

    Hi Karl

    Sadly you cannot, the UI is just that, a UI framework.  It doesn’t have any form style capabilities.

    In order to scroll the screen up from the keyboard so you can see your entry fields you would have to either:

    • Move the UI elements (preferably grouped under a single empty GO) up the screen to allow for the keyboard.
    • Use a Camera variant of the canvases (SS – Camera or Worldspace) and move the camera down to allow for the keyboard overlay

    In either case you would also have to check for the presence of a virtual keyboard so that it wouldn’t affect deployments that have a physical keyboard, such as desktops and web apps.

     

    I think this would make for a great asset for the UI store 😀

    Simon (Darkside) Jackson
    @SimonDarksideJ

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Unity 3D UI Essentials’ is closed to new topics and replies.