在 ButtonBar 中设置 Spark 按钮宽度

发布于 2024-09-18 08:05:46 字数 308 浏览 4 评论 0原文

如何设置 Spark ButtonBar 中的各个按钮大小?它曾经是这样的:

<mx:ButtonBar id="myButtonBar" buttonHeight="12" buttonWidth="250" >

当我尝试在 Spark 中执行相同操作时,出现错误:

无法解析组件类型spark.components.ButtonBar的属性“buttonHeight”

我不想创建一个单独的皮肤...只是如果可能的话可以内联工作

How do I set the individual button sizes in a Spark ButtonBar? It used to be something like:

<mx:ButtonBar id="myButtonBar" buttonHeight="12" buttonWidth="250" >

I get an error when I try to do the same in Spark:

Cannot resolve attribute 'buttonHeight' for component type spark.components.ButtonBar

I don't want to create a separate skin...just something that will work inline if possible

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

万劫不复 2024-09-25 08:05:46

只需设置其布局即可。

<s:ButtonBar id="myButtonBar">
    <s:layout>
        <s:HorizontalLayout variableColumnWidth="false" gap="0" columnWidth="250"/>
    </s:layout>
</s:ButtonBar>

Spark 中的许多事情都不同:)

Just set its layout.

<s:ButtonBar id="myButtonBar">
    <s:layout>
        <s:HorizontalLayout variableColumnWidth="false" gap="0" columnWidth="250"/>
    </s:layout>
</s:ButtonBar>

Many things are just different in Spark :)

生生漫 2024-09-25 08:05:46

我看到有两种不同的方法来解决这个问题。

  1. 创建一个自定义外观类并以这种方式设置按钮宽度。您必须查看现有的 ButtonBar Skin 以找出具体细节。
  2. 扩展按钮类以设置新的按钮宽度,并使用该类为 按钮相关皮肤部件

您还可以回滚到 Flex 3 ButtonBar 并使用 buttonWidth 样式。有些事情在 Halo 中变得更容易。

I see two different ways to approach this.

  1. Create a custom skin class and set the Button Width that way. You'll have to review the existing ButtonBar Skin to figure out specifics.
  2. Extend the button class to set he new button width and use that class to create new factories for the button related skin parts

You could also roll back to the Flex 3 ButtonBar and use the buttonWidth style. Some things are just easier in Halo.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文