Sencha Touch 2停靠的tabpanel

时间:2012-08-23 22:25:44

标签: javascript sencha-touch-2

我有一个带有标签栏的面板和标签栏内的两个标签。我不知道为什么,但似乎我无法将标签栏放在底部。无论我尝试什么,标签栏始终位于页面顶部。

小组:

Ext.define( 'MyApp.view.Manager', {
    // properties
    extend: 'Ext.tab.Panel',
    fullscreen: true,

    requires:
    [
        'Ext.TitleBar'
    ],
    config:
    {
        tabBarPosition: 'bottom',
        tabBar: true,
        items:
        [
            { xtype: 'addorderpanel' },
            { xtype: 'loginpanel' }
        ]
    }
});

上面的面板位于容器内:

Ext.define( 'MyApp.view.Main', {
    // properties
    extend: 'Ext.Container',
    config:
    {
        fullscreen: true
    },

    initialize: function ()
    {
        this.callParent(arguments);

        var manager = Ext.create( 'MyApp.view.Manager' );
        this.add(manager);
    }
});

如果我将第一个面板(' Manager')直接添加到视口,则标签栏位于底部,一切正常。将面板添加到容器中可能是不好的做法,或者我错了?

我希望有人可以帮助我。非常感谢提前!

1 个答案:

答案 0 :(得分:2)

将layout属性添加到Main文件中的config对象。它应该看起来像

Ext.define( 'MyApp.view.Main', {
    // properties
    extend: 'Ext.Container',
    config: {
        fullscreen: true,
        layout:'fit'
    },

    initialize: function () {
        this.callParent(arguments);

        var manager = Ext.create( 'MyApp.view.Manager' );
        this.add(manager);
    }
});

您的标签面板没有任何尺寸,因此标签栏位于顶部。