Вопрос

I have a basic EditText over Google Maps as shown below

enter image description here Whenever I type something into the EditText field, the Google Maps in the "background" will automatically shift itself upwards, like shown below

enter image description here

(Note how the Google copyright logo appears due to the upward shift of the map)

Is there a way to fix this so that the map will remain as is (does not auto-shift) even when I type stuff in the EditText field?

Это было полезно?

Решение

You can simply switch your activity's windowSoftInputMode flag to "adjustPan". Check the official documentation for more info.

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

If you are using ScrollView add this too android:isScrollContainer="false"

Try it..

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top