Leaflet map on android disrupted by appearance of keyboard

萝らか妹 提交于 2019-12-10 11:09:02

问题


I have an android app that uses a webview to point to a website, which contains a leaflet map. On a phone the map is displayed in the top third of the screen. When you click the map a marker is dropped, the map centres on the marker, and a form appears. So far so good. But when you click on the form text area, the android keyboard appears (as it should), but this disrupts the leaflet map. It pushes the tiles and marker upwards off the top of the screen, and sometimes the whole map disappears to reveal the page background. (At least the map returns to normal when the text input area loses focus.) But why is this happening, and how do I fix it?


回答1:


Found the solution here. Simply had to add

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

to AndroidManifest.xml.



来源:https://stackoverflow.com/questions/38509121/leaflet-map-on-android-disrupted-by-appearance-of-keyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!