View 可以在Sencha Touch中从TapPanel导航吗?

View 可以在Sencha Touch中从TapPanel导航吗?,view,navigation,sencha-touch,tabpanel,View,Navigation,Sencha Touch,Tabpanel,我正在使用Sencha Touch,希望从一个视图向下导航到一个视图 Ext.create('Ext.TabPanel', { itemId: 'panel', fullscreen: true, defaults: { styleHtmlContent: true }, tabBarPosition: 'bottom', layout: { type: 'card', animation: {

我正在使用Sencha Touch,希望从一个视图向下导航到一个视图

Ext.create('Ext.TabPanel', {
    itemId: 'panel',
    fullscreen: true,
    defaults: {
        styleHtmlContent: true
    },
    tabBarPosition: 'bottom',
    layout: {
        type: 'card',
        animation: {
            type: 'fade'
        }
    },
    items: [{
        title: 'Home',
        html: 'Home Screen'
    }, {
        title: 'Contact',
        xtype: 'OfferDetailView'
    }]
});
如果用户在
OfferDetailView
上,我希望有一个按钮,如果用户单击该按钮,它应该导航到一个视图
foo
,并显示一个后退按钮以返回选项卡面板。是否有支持此问题的Sencha Touch功能或框架

我可以将activeItem设置为具有

Ext.Viewport.animateActiveItem(foo,{type:'slide',direction:'left'})


但是没有后退按钮。因此,我必须手动添加它并管理堆栈上的所有视图。

您应该创建一个
Ext.navigation.View
,其中包含
Ext.tab.Panel
作为唯一对象。然后,您可以将新视图推送到该视图上,它将按照您的期望工作

Ext.create('Ext.navigation.View', {
    itemId: 'navView',
    layout: 'fit',
    items: [
        {
            xtype: 'tabpanel',
            tabBarPosition: 'bottom',
            items: [{
                title: 'Home',
                html: 'Home Screen'
            }, {
                title: 'Contact',
                xtype: 'OfferDetailView',
                items: [
                    {
                        xtype: 'button',
                        text: 'Go to Foo',
                        handler: function(btn) {
                            btn.up('navigationview').push({ xtype: 'foo' });
                        }
                    }
                ]
            }]
        }
    ]
});