ToggleButtonBar - 如何仅更改一个按钮的颜色

发布于 2024-12-28 03:01:33 字数 228 浏览 4 评论 0原文

我有一个tooglebuttonbar(有4个按钮),我想根据特定数据仅更改一个或两个按钮的颜色。 有人有经验可以做到这一点吗?

我尝试这样做

 var child:Button;
   child = Button(tbbAction2.getChildAt(0));
child.setStyle('color', '#CC33CC');

但是没有效果。

I have a tooglebuttonbar (with 4 buttons) and I'd like to change the color of only one or two button according particular data.
Is someone has experience to do that.

I try to do like that

 var child:Button;
   child = Button(tbbAction2.getChildAt(0));
child.setStyle('color', '#CC33CC');

But there's no effect.

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

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

发布评论

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

评论(1

朮生 2025-01-04 03:01:33

听起来您需要扩展 ToggleButtonBar 和/或皮肤。在皮肤中,您应该能够检查数据并根据数据值显示颜色。或者在皮肤中创建具有您想要的颜色的第二个状态。根据您的价值观,您将切换到第二种状态。

It sounds like you'll need to extend ToggleButtonBar and / or the skins. In the skin you should be able to check the data and display the color based on the value of the data. Or create a second state in the skin that has the color you want. Depending on your values you would switch to the second state.

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