【问题标题】:Scroll Issue in Sencha TouchSencha Touch 中的滚动问题
【发布时间】:2011-11-11 08:32:41
【问题描述】:

我有一个应用程序,其中 UI 组件被动态添加到 formField。由于放置在屏幕上的 UI 控件是根据服务器响应在运行时决定的,因此有时屏幕会被多个组件填满。添加屏幕元素后,我需要滚动屏幕以选择位于屏幕末尾的字段。但是当我滚动表单时会反弹,但滚动并没有按照预期的方式发生。现在我无法选择放置在表单末尾的 UI 控件。

屏幕有 3 个组件,标题栏、按钮 Dock 栏和一个表单域。这是我用于表单字段的代码

    var formBase = new Ext.form.FormPanel({
                scroll: 'vertical',
                xtype: 'form',
                ui: 'round',
// i have added the items and it shows on UI, As things are dynamic i cant place it here
                items: [{}]; 

    });

帮我解决这个问题。

【问题讨论】:

  • 您是否将此表单放在另一个面板中?你能分享完整的代码吗?添加项目后,您是否在调用 formBase.doLayout();功能?
  • 我用过scroll: 'vertical', pinHeaders: true,现在可以用了。

标签: sencha-touch extjs sencha-touch-2


【解决方案1】:

试试这个应该可以的。

 Ext.apply(this, {
            scroll: 'vertical',
            pinHeaders: true,
            dockedItems : [{}],
            items : []
        });
       MyApp.views.MyScreenScreen.superclass.initComponent.call(this);
    },

【讨论】:

    【解决方案2】:

    这是因为表单高度。将height 属性添加到传递给FormPanel 的对象中。像这样的:

    height: Ext.Viewport.getWindowHeight()-(the height of other compenents like toolbar)
    

    例如:

    height: Ext.Viewport.getWindowHeight()-50
    

    【讨论】:

      【解决方案3】:

      添加具有某些值的 height 配置可能会解决问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-12-15
        • 1970-01-01
        • 2013-07-31
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多