Applying style to Tooltip in Flex 4
Applying style to Tooltips in Flex is more simpler than in Flex 3.
In Flex4 Style tag is used to define styles for the application,Style tag is component of http://ns.adobe.com/mxml/2009 package.here is the sample style class to styleing tooltip component
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/halo";
mx|ToolTip {
backgroundAlpha: 1.0;
fontSize: 21;
backgroundColor: #456789;
color: white;
cornerRadius: 0.5;
}
</fx:Style>
We can also do the same using the Actionscript code,here is the sample code for that
private function init():void {
var cssDecl:CSSStyleDeclaration = StyleManager.getStyleDeclaration("mx.controls.ToolTip");
if (!cssDecl) {
cssDecl = new CSSStyleDeclaration("mx.controls.ToolTip");
}
cssDecl.setStyle("backgroundAlpha", 1.0);
cssDecl.setStyle("backgroundColor", "black");
cssDecl.setStyle("color", "white");
cssDecl.setStyle("cornerRadius", 0);
cssDecl.setStyle("fontSize", 24);
}
0 comments:
Post a Comment