Flex 警报窗口样式
我正在尝试在外部文件上设置警报窗口的样式,但收到以下警告,并且不会应用该样式,请记住,警报也是从外部 AS 文件调用的,因此代码未嵌入MXML。
CSS 类型选择器“Alert”未处理,因为应用程序中未使用 Alert。
CSS 选择器“警报”中的类型警报必须使用命名空间进行限定。
Alert{
color : #124332;
background-color: #ffffff;
header-colors : #243322, #243322;
header-height:19;
drop-shadow-enabled: true;
drop-shadow-color :#243322;
corner-radius :6;
border-style :solid;
border-thickness: 1;
border-color : #243322;
footer-colors : #243322, #ffffff;
title-style-name : "title";
}
I am trying to style the Alert window on an external file but I get the following warning and the style won't be applied, keep in mind that the Alert is being called from an external AS file as well so the code is not embedded in the MXML.
The CSS type selector 'Alert' was not processed, because the Alert was not used in the application.
Type alert in CSS selector 'Alert' must be qualified with a namespace.
Alert{
color : #124332;
background-color: #ffffff;
header-colors : #243322, #243322;
header-height:19;
drop-shadow-enabled: true;
drop-shadow-color :#243322;
corner-radius :6;
border-style :solid;
border-thickness: 1;
border-color : #243322;
footer-colors : #243322, #ffffff;
title-style-name : "title";
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Flex 4 中的每个 CSS 文件都必须以默认命名空间开头:
在您的特定情况下,您没有在警报上指定命名空间,请尝试以下操作:
至于有关未使用该命名空间的警告,请忽略该警告。这只是编译器警告未使用的样式的一种方法,以便您可以减少文件大小。如果需要,您可以随时在项目的编译器选项中使用
-show-unused-type-selector-warnings=false
删除基于 CSS 的警告。Every CSS file in Flex 4 must start with the default namespace:
In your particular case, you're not specifying a namespace on your Alert, try this:
As for the warning about it not being used, ignore that one. It's just a way for the compiler to warn about unused styles so that you can reduce filesize. If you want, you could always remove warnings that are CSS based with
-show-unused-type-selector-warnings=false
in the compiler options of your project.