如何在Ext.Container中滚动

时间:2014-12-18 00:27:22

标签: sencha-touch

以下是我的观点。如何让我的菜单分开滚动,我的视图滚动分开

Ext.define('HaBoMobile.view.AboutView', {
    extend: 'Ext.Container',
    xtype: 'aboutViewType',
    html: 'Learn more about me',
    styleHtmlContent: true,
    scrollable : {
        direction     : 'vertical',
        directionLock : true
    },
    overflowY: 'auto',
    autoScroll: true,
    config: {
        fullscreen: true,
        items: [{
            docked: 'top',
            xtype: 'titlebar',
            items: [{
                text: 'Menu',
                action: 'nav',
                iconCls: 'list'
            }]
        }]
    }
});

我尝试了所有这些设置,没有效果    可滚动:{             方向:'垂直',             directionLock:是的         },         overflowY:' auto',         autoScroll:true,

这是一个Sencha fiddle

1 个答案:

答案 0 :(得分:0)

试试scrollable: true,就像这样: -

 var menu = Ext.create('Ext.Menu', {
             scrollable: true,  // add this property
            width: 200,  // Need to set a width 
            items: [{
                text: 'Close',
                ui: 'decline'
            }, {
                text: 'Home',
                action: 'nav_option',
                iconCls: 'home'
            }, {
                text: 'Settings',
                action: 'nav_option',
                iconCls: 'settings'
            }]
        });

容器: -

Ext.define('Fiddle.view.Main', {
    extend: 'Ext.Container',
    xtype: 'mainview',
    config: {            
        scrollable: true,
         html: 'Main page',
        items: [{
            docked: 'top',
            xtype: 'titlebar',
            title: 'Main',
            items: [{
                text: 'Nav',
                action: 'nav'
            }]
        }]
    }
});