sencha touch tabpanel标签的图标

时间:2011-08-03 09:29:13

标签: html5 sencha-touch extjs

我在sencha touch中有一个tabpanel,看起来像是

Mobile.RootViewport = new Ext.TabPanel({
    fullscreen:'true',
    layout: 'card',
    tabBarDock: 'bottom',
    items: [Mobile.HomeViewport, Mobile.AboutViewport]
})

如何为每个标签设置图标?

1 个答案:

答案 0 :(得分:5)

您需要在TabPanel(HomeViewport,AboutViewport等)中的每个iconCls添加items属性。

有一些图标被编译到默认主题中,但 pictos 目录中有许多更多(在$touch/resources/themes/images/default/pictos/处找到)。 iconCls名称与没有.png。

的文件名相同

如果您尝试使用不在默认主题中的图像,您将只获得一个空白方块,但您可以通过编辑主题的.scss文件并添加行来添加更多内容以包含图像:

@include pictos-iconmask('refresh5');  // includes pictos/refresh5.png

有关更改主题的帮助,请参阅An introduction to Theming Sencha Touch