Flex4中修改toolTip的字体以及效果
在Flex4的可视组件中,可以通过toolTip指定鼠标移到对应组件上显示的文字内容,可是默认的字体大小太小了,修改的话,是有一个全局的设置:
StyleManager.getStyleDeclaration("mx.controls.ToolTip").setStyle("fontSize","12");
toolTip除了可以设置样式外,还可以设置各种效果,下面的例子,是在toolTip显示的时候,旋转一圈:
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="application1_creationCompleteHandler(event)"> <s:layout> <s:BasicLayout/> </s:layout> <fx:Script> <![CDATA[ import mx.events.FlexEvent; import mx.managers.ToolTipManager; protected function application1_creationCompleteHandler(event:FlexEvent):void { ToolTipManager.showEffect = rotate; } ]]> </fx:Script> <fx:Declarations> <mx:Rotate id="rotate" /> </fx:Declarations> <s:TextArea x="124" y="126" toolTip="弹出提示文字" /> </s:Application>