apache-flex - skinClass 在 mxml 中工作,但不在外部 css 中

标签 apache-flex flex4

我在 mxml 文件中有一个简单的按钮,如果我在标签本身中设置 skinClass 属性它可以工作,但是,如果我在外部 css 文件中设置 skinClass 属性,它不适用于按钮。

作品:

View .mxml

<s:Button id="btnRefresh" skinClass="skins.RefreshButtonSkin"/>

不起作用:

View .mxml
<s:Button id="btnRefresh"/>

样式文件
#btnRefresh
{
    skinClass: ClassReference("skins.RefreshButtonSkin");
    fontSize: 12px;
}

有人知道我怎样才能让这个 css 工作吗?

注意:我可以使用 css 将其他样式应用于按钮,例如 fontSize 工作

编辑:附加信息

该按钮嵌套在我的 View 的 actionContent 部分

View .mxml
<s:actionContent>
    <s:Button id="btnRefresh"/>
</s:actionContent>

css 文件在我的主 mxml 文件中声明

主文件
<fx:Style source="style.css"/>

我正在编译 flex 4.5.1,它是一个移动应用程序

最佳答案

这似乎是 ActionBar 中的一个错误。成分。我尝试过 id 选择器( #btnRefresh )、类选择器( .btnRefreshStyle )、组件选择器( s|Button )和@Thembie 的建议。

我试过使用 skinClassskin-class .

当按钮位于 actionContent 中时,这些都不起作用。 View 的属性(property)成分。但是当您将按钮移动到 View 时,一切正常。成分。

所以我担心你被困在硬编码那个皮肤类。您可能会考虑提交错误报告。

关于apache-flex - skinClass 在 mxml 中工作,但不在外部 css 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6608049/

相关文章:

apache-flex - 在flex中使用id获取对象?

actionscript-3 - 如何在失败时访问 HTTP 响应正文?

apache-flex - 如何在 ItemRenderer 中使用超出数据网格范围的变量?

actionscript-3 - 如何使用 IExternalization?

apache-flex - 直接从 flex 连接任何数据库

flash - 在没有 Flash Builder 的情况下构建 ActionScript 3.0 应用程序

apache-flex - 将使用 Flex 4 SDK 编译的 Flex 模块加载到使用 Flex 3.5 编译的应用程序中

css - flex : can I completely remove buttons effects?

css - 音量条的自定义皮肤

actionscript-3 - 在 Adob​​e AIR 应用程序中创建通知窗口