Flex Alert.styleName 不适合我
我有这段代码,但样式没有被应用。我见过网络上的文章,这应该起作用。有什么想法吗?
var alert:Alert = Alert.show("You have not saved you changes.\n\nWould you like to save now?",
"Save Answers?",
Alert.NO | Alert.YES | Alert.CANCEL,
this,
handleUnsavedChanges,
null,
Alert.YES);
alert.styleName = "alertStyle";
尝试使用样式表中的 Alert 类设置样式似乎可行,但会引发警告。我想找到“批准”的方式。
顺便说一句,这是 Flex 3。
PS - 我也尝试过类似的东西
alert.setStyle("backgroundColor", "0x00FF00");
,但这似乎也不起作用。我觉得我需要调用一些东西来告诉警报框重新绘制自身,但我不知道如何。
I have this code, but the style is not being applied. I've seen articles on the web where this should work. Any ideas?
var alert:Alert = Alert.show("You have not saved you changes.\n\nWould you like to save now?",
"Save Answers?",
Alert.NO | Alert.YES | Alert.CANCEL,
this,
handleUnsavedChanges,
null,
Alert.YES);
alert.styleName = "alertStyle";
Attempting to set the style using the Alert class in my stylesheet seems to work, but throws a warning. I'd like to find the "approved" way.
BTW, this is Flex 3.
PS - I've also tried stuff like
alert.setStyle("backgroundColor", "0x00FF00");
but this does not seem to work either. I feel like I need to call something to tell the Alert box to redraw itself, but I don't know how.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以创建一个自定义类以使用特定的 css:
...然后在 CSS 中
或者更复杂一点的示例:
You could create a custom class in order to use specific css:
... Then in the CSS
Or a little more complicated example: