「Ext.Viewport.on('畫'' - 解決方案給我滾動的問題。整個頁面不能在方向更改後滾動,因爲視口高度然後會大於窗口高度。 (Ext.Viewport.getHeight()將不會是相同的方向變化後Ext.Viewport.getWindowHeight()。)
周圍製造使用overidden輸入工作:
創建文件app /覆蓋/field/Input.js
Ext.define('myApp.overrides.field.Input', {
override: 'Ext.field.Input',
initialize: function() {
var me = this;
// Solves problem that screen keyboard hides current textfield
if (Ext.os.is.Android) {
this.element.on({
scope : this,
tap : 'onTap',
});
}
me.callParent();
},
onResize: function(input) {
var me = input;
//if input is not within window
//defer so that resize is finished before scroll
if(me.element.getY() + me.element.getHeight() > window.innerHeight) {
Ext.Function.defer(function() {
me.element.dom.scrollIntoView(false);
}, 100);
}
},
// Solves problem that screen keyboard hides current textfield in e.g. MyTimeRowForm
//old solution with Viewport.on('painted', gave scroll problem when changeing orientation
onTap: function(e) {
me = this;
window.addEventListener("resize", function resizeWindow() {
me.onResize(me);
window.removeEventListener("resize", resizeWindow, true);
}, true);
},
});
,並將其添加到app.js
requires: ['myApp.overrides.field.Input']
截圖有助於您瞭解更後第二次單擊或每次 – SachinGutte 2013-03-24 15:38:54
是否會發生? – 2013-04-01 20:10:49