Android上的传单地图因键盘外观而中断 [英] Leaflet map on android disrupted by appearance of keyboard

查看:81
本文介绍了Android上的传单地图因键盘外观而中断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Webview指向包含传单地图的网站的android应用.在手机上,地图显示在屏幕的顶部三分之一.当您单击地图时,将放下一个标记,地图将以标记为中心,并显示一个表单.到目前为止,一切都很好.但是,当您单击表单文本区域时,将出现android键盘(应有的样子),但这会破坏传单地图.它将图块和标记向上推离屏幕顶部,有时整个地图消失以显示页面背景. (当文本输入区域失去焦点时,至少地图会恢复正常.)但是为什么会发生这种情况,我该如何解决呢?

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?

推荐答案

找到了解决方案

Found the solution here. Simply had to add

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

到AndroidManifest.xml.

to AndroidManifest.xml.

这篇关于Android上的传单地图因键盘外观而中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆