Show layout when soft keyboard opens

There is a CardView with EditText , and when the keyboard opens, it is placed right below the EditText . But, as shown below, the keyboard is too close to EditText, and pressing the submit button is difficult because there is not enough space.

EditText: enter image description here

EditText with focus: enter image description here

Is there a way to show the keyboard after ending CardView? I saw several similar questions here, but none of them gives me such a solution. Some answers suggest setting paddingBotton to EditText, but that is not what I want. I do not want a place, I want to show the end of CardView too.

Note that I do not want to resize the layout, so "adjustResize" is not a solution, and I already use "adjustPan" in AndroidManifest.xml

 <activity ... android:windowSoftInputMode="adjustPan" /> 

Any thoughts?

+7
android android-layout
source share
1 answer

If you use scrollview. you can do one thing - scroll your scrollview as your requirement

Please see below code for example

 ScrollView sv =(ScrollView)findViewById(R.id.scrl); sv.scrollTo(0, sv.getBottom()); or sv.fullScroll(View.FOCUS_DOWN); 

this is an action that you can perform on the soft input of the Enter key.

There is another solution that you can hide the keyboard sentence by specifying

 android:inputType="textNoSuggestions" 
0
source share

All Articles