0

今天给你一个简单的问题...

这有效:

var carousel = Ext.create('Ext.Carousel', {
            fullscreen: 'true',

            //load in views view clean instantiation using
            // the widget.alias's defined in each view... yea
            // For some reason, putting flex on these components... oh...
            // Have to call directly in by just the xtype since these are just
            // references..
            items: [
                { 
                    xtype: 'Main'
                },
                { 
                    xtype: 'CommentList'
                }                
            ]

这不起作用:

var tabpanel = Ext.create('Ext.TabPanel', {
            fullscreen: 'true',
            tabBarPosition: 'bottom',

            defaults: {
                styleHtmlContent: true
            },

            //load in views view clean instantiation using
            // the widget.alias's defined in each view... yea
            // For some reason, putting flex on these components... oh...
            // Have to call directly in by just the xtype since these are just
            // references..
            items: [
                { 
                    xtype: 'Main',
                    title: 'The Main',
                    iconCls: 'user'
                },
                { 
                    xtype: 'CommentList',
                    title: 'Comments',
                    iconCls: 'user'
                }                
            ]

        });

如您所见,它们几乎相同,除了一个是 TapPanel(添加了所需的默认配置),另一个是轮播。

其他一切都完全一样......这是我的 Sencha Touch 2.0 应用程序的 app.js 中的,它是按照 MVC 架构设计的。

不工作的 TabPanel 的结果是我只看到第一个视图(主)并且屏幕底部没有出现标签栏。

任何想法我的问题可能是什么?

4

2 回答 2

1

我不确定这是否是一个问题,但在我的代码中,该行是:

Ext.create("Ext.tab.Panel", {

不是:

Ext.create('Ext.TabPanel', {
于 2012-04-16T12:10:24.727 回答
0

全屏应该fullscreen: true代替fullscreen: 'true'. 您还可以添加此代码以使它们切换:

cardSwitchAnimation: {type: "fade", duration: 1000},
layout: "card",

没有测试它,但它对我有用(从我自己的代码片段中获得)

于 2011-12-21T10:01:06.463 回答