【问题标题】:Is there a possibility to increase font size of the spark label truncation tip in Flex 4?是否有可能增加 Flex 4 中火花标签截断提示的字体大小?
【发布时间】:2012-11-25 07:51:47
【问题描述】:
我在我的项目中使用 Spark Label (Flex 4.6 SDK) 在表单上显示一些文本,如果文本不适合一行,则会显示截断提示(使用 maxDisplayedLines="1" 和 showTruncationTip="真”属性)。但是提示中的字体非常小,我想增加它,但实际上我不知道如何做到这一点。
【问题讨论】:
标签:
actionscript-3
apache-flex
label
flash-builder
flex-spark
【解决方案1】:
好的,所以这是可行的,但一开始并不那么容易看到。
showTruncationTip 告诉标签在鼠标悬停时如果 isTruncated 为真,则创建一个工具提示。因此,有了这些知识,我们就可以监听关于正在创建的工具提示的触发事件,并对工具提示进行一些替换或样式化。
private var myTip:IToolTip;
// somewhere in your code
label.addEventListener(ToolTipEvent.TOOL_TIP_SHOWN, createCustomTip);
private function createCustomTip(event:ToolTipEvent):void {
myTip = event.toolTip;
// do stuff to the existing toolTip or replace it with a custom one
}
这里有关于如何创建和替换自定义工具提示的完整文档Creating Custom Tool Tips