问题描述
当我点击一个文本框在屏幕的底部,键盘出现,隐藏有源元件。在iOS上,它的工作原理完美。
When I tap a textfield at the bottom of the screen, the keyboard appears and hides the active element. On iOS, it works perfect.
我能够滚动的形式,所以文本框在可见光区域,但是这不是很好的。我是不是做错了什么或者这是一个已知的错误,因为我在这个例子中,从煎茶触摸本身相同的行为:docs.sencha.com/touch/2-1/touch-build/examples/forms /
I'm able to scroll the form, so the textfield is in the visible area, but that's not nice at all. Am I doing something wrong or is this a known bug as I have the same behaviour in this example from Sencha Touch itself: docs.sencha.com/touch/2-1/touch-build/examples/forms/
如果对这种形式:
我挖掘生物的文本框,键盘隐藏,而不是滚动文本框最多有它明显的,而键入文本框,:
I tap in the textfield of "Bio", the keyboard hides the textfield, instead of scrolling the textfield up to have it visible while typing:
推荐答案
这是明确一个已知的问题,我见过很多次在Android上。你可以尝试做的唯一事情是监听输入领域的焦点事件,然后滚动到的元素。你可能有玩弄权是
- 值,适合您的情况最好的。
This is definitively a known-issue, I've seen this many times on Android. The only thing you can try to do is listen for a focus event on the input field and then scroll to the element. You might have to play around with the right Y
-value, which suits your situation best.
{
xtype: 'textareafield',
name: 'bio',
label: 'Bio',
maxRows: 10,
listeners: {
focus: function(comp, e, eopts) {
var ost = comp.element.dom.offsetTop;
this.getParent().getParent().getScrollable().getScroller().scrollTo(0, ost);
}
}
},
这对我的作品。如果您需要任何执行此帮助,让我知道!
This works for me. If you need any help implementing this, let me know!
这篇关于煎茶触摸2.1:表单面板键盘隐藏在Android活跃文本字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!