如何自动滚动到输入框在Android的时候,软键盘上显示他们重叠? [英] How to auto-scroll to input field in Android when the soft keyboard overlaps them on showing?

查看:1138
本文介绍了如何自动滚动到输入框在Android的时候,软键盘上显示他们重叠?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发使用工作灯的混合应用程序,我遇到了以下问题:

I am developing a hybrid app using Worklight, and I am experiencing the following issue:

当用户点击的输入字段,所述软键盘弹出隐藏输入字段时,后者是相对低的在屏幕上。页是可滚动的,因此,用户可以滚动并且再次看到的领域,但在客户的要求定义的网页将自动滚动直到场可见。

When the user clicks on an input field, the soft keyboard that pops up hides the input field when the latter is relatively low on the screen. The page is scrollable, so the user can scroll and see the field again, but the customer requirements define that the page will auto-scroll until the field is visible.

请注意,这种情况只有在Android环境。在iPhone和iPad环境的默认行为是所需的。

Please note that this happens only in the Android environment. In the iPhone and iPad environments the default behavior is the the desired one.

根据我的调查结果,关键要通过做安卓windowSoftInputMode 在Android清单文件的属性。然而,我所有的努力,有没有实现自动滚动。

Based on my findings, the trick should be done via the android:windowSoftInputMode attribute in the Android manifest file. However, all my efforts there failed to achieve the auto-scroll.

如果有一个解决方案,工作灯具体,我想preFER使用它,而不是介入的Andr​​oid原生code。

If there is a solution that is Worklight specific, I would prefer to use it, rather than intervening in the Android native code.

推荐答案

这是不是真正的工作灯在所有...但对网络应用程序一般在Android中,似乎(从堆栈溢出的快速搜索)。

This isn't really about Worklight at all... but about web apps in general in Android, it seems (from a quick search in Stack Overflow).

下面是一些建议的解决方案,从你的不同:

Here are some suggested solutions, that differ from yours:

  • <一个href="http://stackoverflow.com/questions/7026854/textbox-hidden-below-keyboard-in-android-webview">Textbox藏于键盘的Andr​​oid的WebView
  • <一个href="http://stackoverflow.com/questions/2729932/html-textfield-in-webview-in-an-android-application-is-hidden-by-the-soft-keyboa">html文本字段中的WebView在Android应用程序是隐藏的软键盘
  • <一个href="http://stackoverflow.com/questions/19897422/keyboard-hiding-edittext-when-androidwindowtranslucentstatus-true">Keyboard隐藏的EditText当机器人:windowTranslucentStatus =真

  • 您可以还可能使用iScroll.js(精简版版) - 或捕捉焦点事件自己实现 - 滚动像素的具体数额向上
  • Textbox hidden below keyboard in Android webview
  • html textfield in WebView in an Android application is hidden by the soft keyboard
  • Keyboard hiding EditText when android:windowTranslucentStatus=true

  • You could possibly also use iScroll.js (lite edition) - or implement this yourself by catching the focus event - to scroll a specific amount of pixels upwards.

这篇关于如何自动滚动到输入框在Android的时候,软键盘上显示他们重叠?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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