我有一个包含两个文本框和一个登录按钮(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