문제

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