Search Unity

Stop Input Field keyboard from vanishing when you tap something else?

Discussion in 'iOS and tvOS' started by Morgan, Oct 5, 2015.

  1. Morgan

    Morgan

    Joined:
    May 21, 2006
    Posts:
    1,223
    My app relies on an Input Field (I need to full OS-level predictive text, selection, copy/paste, spellchecking, etc.), but it also has a palette of buttons for changing the color of the text (all of it at once, nothing complex).

    Unfortunately, apping on a color button (or anything in Unity) makes the keyboard vanish—always has—but in Unity 4.6 I could fix that by making the color buttons immediately trigger...

    field.ActivateInputField();​

    ...which instantly re-activated the field, and the keyboard never so much as flickered. Problem solved.

    Until Unity 5. Now, ActivateInputField() no longer fixes the issue:

    - The keyboard animates away (partly) and animates back again: it's really annoying because as you try different colors, the keyboard keeps bouncing up and down.

    - Except for about 1 time in 6, when it does nothing, and the keyboard is just gone.
    Both of these seem like maybe field.ActivateInputField is just slow now: too slow to hide the animation, and not reliable. (Tested iOS 8 and 9, iPad and iPhone 6 Plus: always worked fine in Unity 4.6, always a problem now.)

    It feels really broken to use, and my users will not like this step back.

    I'd be happy to try a totally different approach if there is one.

    Any suggestions for getting that keyboard to stay put the way it could be in 4.6? (I'd just stick with 4.6, but I need Asian unicode characters, which have a bug in iOS 9. Half my downloads are in Japan!)

    Thanks in advance!