我使用一个文件来声明 CSS 样式:
/* CSS file */
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@namespace view "com.myviews.*";
@namespace comp "com.myviews.mycomponents.*";
@font-face {
font-family:arial_s;
src:url("Fonts/Arial.ttf");
embed-as-cff:true;
font-weight:normal;
font-style:normal
}
@font-face {
font-family:arial_mx;
src:url("Fonts/Arial.ttf");
embed-as-cff:false;
font-style:normal;
font-weight:normal;
}
global {
font-family:arial_s; font-size:12.5;
}
s|DropDownList {
cornerRadius:0;
}
Q1:我在上面的 s|DropDownList 行中收到此警告:
The CSS type selector 'spark.components.DropDownList' was not processed, because the type was not used in the application.
但它是在应用程序中使用的,在这里改变它的值确实有效果。知道为什么我会收到此警告吗?
Q2:当我在调试模式下运行应用程序时,我收到警告:
warning: incompatible embedded font 'arial_s' specified for mx.core::UITextFormat. This component requires that the embedded font be declared with embedAsCFF=false.
警告来了,因为我在global
上面使用了 spark 组件的属性,这导致它应用于所有组件,包括一些 mx 组件。这里感兴趣的组件是 DataGrid 单元格中的文本。我只需要弄清楚如何分别定义 mx.core::UITextFormat 的样式。知道这个的语法是什么吗?我试过了:
mx|UITextFormat {
font-family:arial_mx;
}
但它不起作用。不知道该怎么办。 http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/core/UITextFormat.html