sencha touch tabpanel标签的图标

lau*_*tra 2 html5 extjs sencha-touch

我有一个sencha touch的tabpanel,看起来像下面的东西

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

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

Chr*_*loe 5

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

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

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

@include pictos-iconmask('refresh5');  // includes pictos/refresh5.png
Run Code Online (Sandbox Code Playgroud)

如需更改主题的帮助,请参阅Theming Sencha Touch简介