【问题标题】:Setting multiple styles to a custom LabelItemRenderer?将多个样式设置为自定义 LabelItemRenderer?
【发布时间】:2011-11-19 14:33:12
【问题描述】:

我制作了一个自定义的 LabelItemRenderer,在其中我想为 StyleableTextField 提供一些额外的样式。如何在不丢失继承样式的情况下做到这一点?我尝试了不同的方法,但总是收到错误提示必须设置 antiAliasType。

s|List.customListStyle
{
    fontFamily: Arial;
    fontSize: 18;
    contentBackgroundAlpha: 0.25;
    verticalScrollPolicy: auto;
    downColor: #CCCCCC;
}
s|List.customListStyle sw|CustomListItemRenderer
{
    paddingLeft: 20;
}

我应该如何设置我的文本字段样式,然后在 createChildren 方法中设置?

【问题讨论】:

  • 如果你扩展了一个类,你应该自动继承所有的样式。是什么让你觉得你正在失去他们?哪一行代码给出了错误?这是代码问题还是 CSS 问题?
  • 问题是我不希望我的所有 LabelItemRenderer 都获得内部 StyleableTextField 的样式。我可以使用 setStyle(),但想使用 CSS 来实现。

标签: apache-flex flex4.5 flex-mobile


【解决方案1】:

由于我无法通过使用外部 CSS 来实现这一点并且没有得到任何回复,我决定使用 setStyle。这不是我想要的,但它确实有效......

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-17
    • 2021-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-05
    相关资源
    最近更新 更多