Softkeyboard blocking EditText

2019-06-04 08:13发布

问题:

I'm having the following problem:

I have an activity which enables a user to post comments on some article. When the user taps the EditText field where the comment can be posted, the softkeyboard ends up blocking the text field such that the user can't see what is being typed. How can I make sure that the EditText field is always, at least partly, visible?

回答1:

Add the contents of your activity to a scrollable layout and when the EditText view gets focus manually scroll the ScrollView.



回答2:

Make your layout scrollable by using scrollview so that the Edittext will scroll to up and placed above the softkeyboard and you can view the EditText.