admin管理员组文章数量:1306996
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.
Please note that this happens only in the Android environment. In the iPhone and iPad environments the default behavior is the the desired one.
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.
If there is a solution that is Worklight specific, I would prefer to use it, rather than intervening in the Android native code.
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.
Please note that this happens only in the Android environment. In the iPhone and iPad environments the default behavior is the the desired one.
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.
If there is a solution that is Worklight specific, I would prefer to use it, rather than intervening in the Android native code.
Share Improve this question edited Jun 20, 2014 at 14:20 Idan Adar 44.5k14 gold badges52 silver badges91 bronze badges asked Jun 20, 2014 at 13:13 M. SfakianosM. Sfakianos 2501 gold badge3 silver badges9 bronze badges1 Answer
Reset to default 3This 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:
- 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.
本文标签:
版权声明:本文标题:javascript - How to auto-scroll to input field in Android when the soft keyboard overlaps them on showing? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741830760a2399915.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论