Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sencha touch 2 Sencha touch日期选择器和ios软键盘_Sencha Touch 2 - Fatal编程技术网

Sencha touch 2 Sencha touch日期选择器和ios软键盘

Sencha touch 2 Sencha touch日期选择器和ios软键盘,sencha-touch-2,Sencha Touch 2,我有一个字段集,有几个文本字段和一个日期选择器字段 除文本字段处于焦点且ios键盘处于可见状态外,所有操作都正常。如果我点击键盘顶部的下一个(或后退)按钮,并因此将标签插入到数据包中,而不是将数据放在屏幕的底部,它会飞到中间的某个地方。我猜这是因为键盘向上推webview,而日期选择器仍试图停靠在屏幕一半的底部 这发生在模拟器(见屏幕截图)和我的设备上 有什么解决办法吗?我可以延迟日期选择器弹出,直到键盘重新按下吗 顺便说一句,Sencha触摸选择字段也会出现这种情况,您可以更新选择器组件代码:

我有一个字段集,有几个文本字段和一个日期选择器字段

除文本字段处于焦点且ios键盘处于可见状态外,所有操作都正常。如果我点击键盘顶部的下一个(或后退)按钮,并因此将标签插入到数据包中,而不是将数据放在屏幕的底部,它会飞到中间的某个地方。我猜这是因为键盘向上推webview,而日期选择器仍试图停靠在屏幕一半的底部

这发生在模拟器(见屏幕截图)和我的设备上

有什么解决办法吗?我可以延迟日期选择器弹出,直到键盘重新按下吗


顺便说一句,Sencha触摸选择字段也会出现这种情况,您可以更新选择器组件代码:

touch/src/picker/Date.js:

/**
 * Update by ZWD/gloot
 * Date: 7/30/2013
 */
onDoneButtonTap: function() {
    var me = this;
    var oldValue = this._value,
        newValue = this.getValue(true),
        testValue = newValue;

    if (Ext.isDate(newValue)) {
        testValue = newValue.toDateString();
    }
    if (Ext.isDate(oldValue)) {
        oldValue = oldValue.toDateString();
    }

    if (testValue != oldValue) {
        this.fireEvent('change', this, newValue);
    }

    setTimeout(function() {
        me.hide();
        me.inputBlocker.unblockInputs();
    }, 300);

    Ext.hideKeyboard();
}
和picker/picker.js

/**
 * @private
 * Called when the done button has been tapped.
 * Update by ZWD/gloot
 * Date: 7/30/2013
 */
onDoneButtonTap: function() {
    var me = this, oldValue = me._value,
        newValue = me.getValue(true);

    if (newValue != oldValue) {
        me.fireEvent('change', me, newValue);
    }

    setTimeout(function() { 
        me.hide();
        me.inputBlocker.unblockInputs();
    }, 300);

},

/**
 * @private
 * Called when the cancel button has been tapped.
 * Update by ZWD/gloot
 * Date: 7/30/2013
 */
onCancelButtonTap: function() {
    var me = this;
    me.fireEvent('cancel', me);

    setTimeout(function() {
        me.hide();
        me.inputBlocker.unblockInputs();
    }, 300);
}
//////////////////////////////////////////////////////

the setTimeout method can solve the question!