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