Sencha Touch 2:列表未显示在选项卡面板中

时间:2012-12-13 04:12:34

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

后台:我正在使用senchatouch 2 MVC框架开发应用程序。 我正在使用带有两个标签的tabpanel的屏幕上工作。

问题:在第一个标签中,我想显示titleBar和List。我可以显示titleBar但不能显示选项卡中的列表。当我使用谷歌浏览器检查元素时,列表显示为空。我正在使用sencha网站上的示例列表代码。我能够在另一个面板中显示列表,但是当我将它作为项目放在tabPanel中时,它不会显示。

这是我正在使用的代码:

Ext.define('POC.view.WUHomePage', {
    extend: 'Ext.TabPanel',
    requires: ['Ext.TitleBar', 'Ext.dataview.List', 'Ext.data.proxy.JsonP'],
    alias: 'widget.wuHomePageView',

    config: {
        fullscreen: true,
        tabBarPosition: 'bottom',
        cardSwitchAnimation: 'slide',
        defaults: {
            styleHtmlContent: true
        },

        items: [{
            // This is first tab
            title: 'Home',
            iconCls: 'home',
            items: [{
                xtype: 'titlebar',
                title: 'Hello',
                docked: 'top',
                items: [{
                    xtype: 'button',
                    text: 'LogOut',
                    ui: 'action',
                    itemId: 'newButton',
                    align: 'right'
                }]
            }, {
                xtype: 'list',
                title: 'Sample',
                fullscreen: true,
                itemTpl: '{title}',
                data: [{
                    title: 'Item 1'
                }, {
                    title: 'Item 2'
                }, {
                    title: 'Item 3'
                }, {
                    title: 'Item 4'
                }]
            }]
        },
        // This is second tab
        {
            title: 'Contact',
            iconCls: 'user',
            html: 'Contact Screen'
        }]
    },

});    

1 个答案:

答案 0 :(得分:5)

不要将列表设置为全屏。只应将一个组件设置为全屏,在您的情况下,它是TabPanel。而是将列表设置为高度100%,将父组件设置为适合布局。

相关问题