How to set distance from soft keyboard to EditText?

I have a problem with a soft keyboard overlapping parts of EditTexts.

When I click on EditTexts, the soft keyboard appears just below the text, which means that part of the text field is not displayed when the soft keyboard overlaps it.

Any ideas on how to increase the distance between the EditText and the Soft Keyboard?

+4
source share
4 answers

The problem is not caused by EditText, but by TextViews, which messed up the layout.

0
source

Certain solutions will be available that work several times, and sometimes not what I use will work and will process your script. Use the following steps step by step.

1- Add a scroll view to the layout inside the main layout

2- get the link

3 now use the following code snippet

editTextField.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { // TODO Auto-generated method stub v.postDelayed(new Runnable() { @Override public void run() { // TODO Auto-generated method stub /*if(Build.VERSION.SDK.equals("4.1.1")||Build.VERSION.SDK.equals("4.1.2")) { } else {*/ scrollView.scrollBy(0, 150); //} } }, 500); } }); 

when an overlay is required on the screen, it will scroll the screen

+1
source

Try this way

In your mainfest.xml

 <activity android:name="YourActivity" android:windowSoftInputMode="stateHidden|adjustResize" /> 
0
source

Just try

Add Gravity Bottom to Edit Text and provide the bottom of the bottom.

  <EditText android:gravity="bottom" android:paddingBottom="10dp" ................ /> 
0
source

Source: https://habr.com/ru/post/1500925/


All Articles