Keyboard suggestions cause part of Android EditText.setError() message to not display

前端 未结 5 1440
迷失自我
迷失自我 2020-12-09 05:14

When I\'m using edittext.setError(\"enter a comment\") in android, it works fine until the keyboard suggestions come up and the error gets pushed above the

5条回答
  •  忘掉有多难
    2020-12-09 05:51

    I have spent a lot of time trying various things to fix this ...

    The easy fix: - make sure your error text is really really short

    The fix that makes it all work:

    When Android displays the softkeyboard, the view with your edit text gets "moved" up ... and the error text moves with this. The truncation usually happens as part of this. You can easily fix this by putting your entire layout in a ScrollView bracket ... in this way Android can move your EditText up by scrolling it with the entire layout - and then the error message will be fully displayed. Try it - it really works.

    P.S: I like that you have posted a screenshot of your problem. Makes things a lot easier.

提交回复
热议问题