sencha touch:没有图标的标签

时间:2021-01-04 23:18:49

Is it possible to create a item in a tabbar-ed card layout, that has no tab?

是否可以在tabbar-ed卡片布局中创建一个没有标签的项目?

I want to create a message overlay that stretches from screen top to the tab bar and doesn't cover the tab bar. When i do this by adding an item to the panel everything works fine except a blank icon is created on the tabbar. Is there a way to prevent this icon from being created?

我想创建一个从屏幕顶部延伸到标签栏但不覆盖标签栏的消息覆盖。当我通过向面板添加项目来做到这一点时,一切正常,除了在标签栏上创建一个空白图标。有没有办法阻止创建此图标?

2 个解决方案

#1


1  

you can create the new item with hidden: true config option

您可以使用hidden:true config选项创建新项目

Ext.define('App.view.settings.SettingsContainer', {
extend: 'Ext.tab.Panel',
xtype: 'settingsContainer',

requires : [
...
],

config: {
    tabBar: {
        docked: 'top'
    },
    tab: {
        title: 'Settings',
        iconCls: 'user'
    },

    items: [{
        xtype: 'settingsAccountContainer'
    }
    , {
        xtype: 'changeCompanyView',
        hidden: true
    }]
}
});

changeCompanyView is created, but no tab icon is visible. It could be activated by

创建了changeCompanyView,但没有可见的标签图标。它可以被激活

settingsContainer.setActiveItem(1);

Cheers, Oleg

干杯,奥列格

#2


0  

This should work. Add the overlay to the child item and not the tab panel.

这应该工作。将叠加层添加到子项而不是选项卡面板。

childPanelItem.add(
    Ext.create('Ext.Panel',  
        {
            xtype:'panel',
            html:'Demo',
            top:0,
            left:0,
            right:0,
            bottom:0
        }
    )
);

If you add to the child panel the icon will not appear on the tab bar.

如果添加到子面板,则图标栏上不会显示图标。

#1


1  

you can create the new item with hidden: true config option

您可以使用hidden:true config选项创建新项目

Ext.define('App.view.settings.SettingsContainer', {
extend: 'Ext.tab.Panel',
xtype: 'settingsContainer',

requires : [
...
],

config: {
    tabBar: {
        docked: 'top'
    },
    tab: {
        title: 'Settings',
        iconCls: 'user'
    },

    items: [{
        xtype: 'settingsAccountContainer'
    }
    , {
        xtype: 'changeCompanyView',
        hidden: true
    }]
}
});

changeCompanyView is created, but no tab icon is visible. It could be activated by

创建了changeCompanyView,但没有可见的标签图标。它可以被激活

settingsContainer.setActiveItem(1);

Cheers, Oleg

干杯,奥列格

#2


0  

This should work. Add the overlay to the child item and not the tab panel.

这应该工作。将叠加层添加到子项而不是选项卡面板。

childPanelItem.add(
    Ext.create('Ext.Panel',  
        {
            xtype:'panel',
            html:'Demo',
            top:0,
            left:0,
            right:0,
            bottom:0
        }
    )
);

If you add to the child panel the icon will not appear on the tab bar.

如果添加到子面板,则图标栏上不会显示图标。