iconCls不工作标签面板栏位置是顶部

时间:2012-08-02 12:15:09

标签: sencha-touch-2 tabbar tabpanel

为什么当标签栏位置在sencha touch 2的顶部时,iconCls无法在标签面板栏中工作?

当标签栏位置在底部时,它可以正常工作。 标签栏位置最高时为什么不起作用?

    Ext.create('Ext.TabPanel', {
    fullscreen: true,
    tabBarPosition: 'top',

    defaults: {
        styleHtmlContent: true
    },

    items: [
        {
            title: 'Home',
            iconCls: 'home',
            html: 'Home Screen'
        },
        {
            title: 'Contact',
            iconCls: 'user',
            html: 'Contact Screen'
        }
    ]
});

上述代码的输出:

enter image description here

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

    defaults: {
        styleHtmlContent: true
    },

    items: [
        {
            title: 'Home',
            iconCls: 'home',
            html: 'Home Screen'
        },
        {
            title: 'Contact',
            iconCls: 'user',
            html: 'Contact Screen'
        }
    ]
});

上述代码的输出:

enter image description here

为什么它没有处于最佳位置?

2 个答案:

答案 0 :(得分:1)

这是Sencha Touch框架类中定义的方式。

如果你想按自己的方式行事,只需覆盖它们:)

答案 1 :(得分:0)

他们就是这样设计的。

在他们看来,如果选项卡面板位于屏幕的底部,它可以看起来很好用图标但是如果它位于屏幕的顶部,那么图标就不能很好..

据说我很同意这个决定,但如果你坚持其他方式,也许你可以尝试添加按钮作为标签面板的项目并将图标放在按钮内