Sencha touch 2 iconCls不工作选项卡面板栏位置为顶部
为什么当sencha touch 2中的选项卡栏位置为顶部时,iconCls在选项卡面板栏中不工作 当选项卡栏位置为底部时,它工作正常。 为什么选项卡栏位置为顶部时不起作用Sencha touch 2 iconCls不工作选项卡面板栏位置为顶部,sencha-touch-2,tabbar,tabpanel,Sencha Touch 2,Tabbar,Tabpanel,为什么当sencha touch 2中的选项卡栏位置为顶部时,iconCls在选项卡面板栏中不工作 当选项卡栏位置为底部时,它工作正常。 为什么选项卡栏位置为顶部时不起作用 Ext.create('Ext.TabPanel', { fullscreen: true, tabBarPosition: 'top', defaults: { styleHtmlContent: true }, items: [ {
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'
}
]
});
上述代码的输出:
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'
}
]
});
上述代码的输出:
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'
}
]
});
为什么它不能在顶层工作?这是Sencha Touch框架类中定义的方式
如果您想按自己的方式进行,只需覆盖它们:)这是Sencha Touch框架类中定义的方式
如果你想按自己的方式来做,只需覆盖它们:)他们就是这样设计的 在他们看来,如果选项卡面板位于屏幕底部,则图标看起来不错,但如果选项卡面板位于屏幕顶部,则图标与选项卡面板不匹配
尽管如此,我还是同意这个决定,但如果你坚持不这样做,也许你可以尝试将按钮添加为选项卡面板的项目,并将图标放在按钮内,他们就是这样设计的 在他们看来,如果选项卡面板位于屏幕底部,则图标看起来不错,但如果选项卡面板位于屏幕顶部,则图标与选项卡面板不匹配 也就是说,我有点同意这个决定,但如果你坚持不这样做,也许你可以尝试添加按钮作为选项卡面板的项目,并将图标放在按钮内