【问题标题】:How does one create a div that uses iconCls to draw icons?如何创建一个使用 iconCls 来绘制图标的 div?
【发布时间】:2012-03-20 10:49:31
【问题描述】:

如何生成一个使用 iconCls 的 div 来填充图标的等价物作为该 div 的内容?

例如

{
xtype:button,
iconCls: 'refresh',
iconMask: true,
}

将生成一个带有刷新图标的按钮。据我所知,Ext & Sencha 是从 CSS 生成的,所以肯定可以在 div 上调用正确的类并让它自动为我绘制刷新图标?

我该怎么做?

【问题讨论】:

    标签: sencha-touch extjs


    【解决方案1】:

    Sencha 不会自动使用您提供的任何名称绘制和图标。只有当 sencha 已经为该图像添加了 iconCls 时,它才可能起作用。但是,您可以自己添加一个 iconCls 并将该类添加到您的 css 中。

    所以,对你来说,css 将是这样的:

    .refresh{
        background : url('your image location');
        height : 16px;  // Height-width of the image
        width : 16px;
    }
    

    【讨论】:

      【解决方案2】:

      我最近还创建了它,它可以帮助您为 Sencha Touch 应用程序准备图标。自述文件解释了在 Ico Moon 网站上创建图标以及使用该工具将 Ico Moon 项目文件转换为 SCSS 以在 Sencha Touch 中使用的步骤。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-12-13
        • 2019-02-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多