Sencha touch 2 Sencha touch 2 setActiveItem主视图错误

Sencha touch 2 Sencha touch 2 setActiveItem主视图错误,sencha-touch-2,Sencha Touch 2,我正在实现一个滑动导航。单击幻灯片导航中的一个列表项时,我正在使用以下控制器代码加载相关视图: switch(index){ case 0: this.getMain().setActiveItem({xtype:'main'}); break; case 1: this.getMain().setActiveItem({xtype:'messagesview'}); break; case 2:

我正在实现一个滑动导航。单击幻灯片导航中的一个列表项时,我正在使用以下控制器代码加载相关视图:

switch(index){
    case 0: 
        this.getMain().setActiveItem({xtype:'main'});
        break;
    case 1: 
        this.getMain().setActiveItem({xtype:'messagesview'});
        break;
    case 2:
        this.getMain().setActiveItem({xtype:'articleslistview'});
        break;
    case 3:
        this.getMain().setActiveItem({xtype:'categoriesview'});
        break;
    default:
    break;
}
这些setActiveItem函数调用中的每一个都能工作,除了第一个on。 当我尝试将主视图设置为活动视图时,出现以下错误:

未捕获错误:[错误][Ext.containerLoadd]将卡添加到选项卡 容器,而不指定任何选项卡配置

上面的代码解决了这个问题

this.getMain().setActiveItem(0);