我有一個包含兩個文本框和一個登錄按鈕(layout:xbox)的簡單認證表單 當我編輯第一個文本框時,此表單完全適合鍵盤和狀態欄,但是當我切換到第二個文本框時,表單會向上滾動一下。當單擊文本框時防止表單向上滾動
問題:有誰知道如何防止滾動發生?
[編輯]代碼
app.views.UserLogin = function (config) {
Ext.apply(this, config);
this.loginField = new Ext.form.Text({
cls: 'auth-login',
width:"100%",
allowBlank: false,
placeHolder:'Identifiant',
border:'0 0 1 0',
});
this.passwordField = new Ext.form.Password({
cls: 'auth-password',
width:"100%",
allowBlank: false,
placeHolder:'Mot de passe',
border:'0',
});
this.loginBtn = new Ext.Button({
width:"200px",
text: "Connect",
handler: this.onLoginBtnFn,
scope: this,
cls:'auth-button',
});
this.authFieldSet = new Ext.form.FieldSet({
width:"90%",
cls:'auth-fieldset',
items:[this.loginField,this.passwordField]
});
//constructor
app.views.UserLogin.superclass.constructor.call(this, {
//dockedItems: [this.toolbar],
fullscreen: true,
cls:'auth',
layout: 'vbox',
items: [
this.authFieldSet,
this.loginBtn
]
});
};
感謝
scrolling = NO?這是從哪裏來的? – 2012-02-28 12:04:46
對不起,延遲應對。您可以使用複選框在界面構建器中禁用滾動功能,或者使用編程功能(如有需要)禁用滾動功能: self.scrollView.scrollEnabled = NO; – RachelC 2012-03-08 16:31:55
這將禁用整個Web視圖的滾動。我只想在輸入文本字段時禁用滾動功能。 – 2012-03-08 17:02:24