Spark TitleWindow的标题栏字体大小更改
当我尝试更改 TitleWindows 标题栏的字体大小时,整个容器更改为新的字体大小。但我不想实现这个目标。我只想将其放在标题栏上。
我使用过的代码(不成功)
<s:TitleWindow name="MyTitleWindow"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
title="Search"
width="1200"
height="800"
fontSize="24"
preinitialize="preInit();"
close="handleCloseEvent(event);" >
---
---
</s:TitleWindow>
我使用的是Flex4和Spark。
While I was trying to change the fontSize of titlebar of TitleWindows, the whole container changes to new font Size. But I do not want to achive this. I would like to get it only on the titlebar.
The code I have used (not successful)
<s:TitleWindow name="MyTitleWindow"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
title="Search"
width="1200"
height="800"
fontSize="24"
preinitialize="preInit();"
close="handleCloseEvent(event);" >
---
---
</s:TitleWindow>
I am using Flex4 and Spark.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议您基于
spark.skins.spark.TitleWindowSkin
创建自己的皮肤,并使用id
更改Label
的相应属性与id
titleDisplay
。您可以在官方文档中阅读有关换肤的更多详细信息< /a>.
您的窗口的示例皮肤如下(仅添加了一个属性):
您可以使用外部 CSS 文件或直接在 MXML 中应用它:
或者在 ActionScript 中:
I suggest you to create your own skin based on
spark.skins.spark.TitleWindowSkin
and change corresponding attributes ofLabel
withid
titleDisplay
.You can read more details about skinning in official documentation.
The sample skin for your window is the following (added just one attribute):
You can apply it with external CSS file or directly in MXML:
Or in ActionScript:
解决了上述问题
我已经通过Actionscript Part
:这样我就可以只更改 titleBar fontSize。
希望它能帮助其他人。
I have managed the above issue by
Actionscript Part:
In this way I could change only the titleBar fontSize.
Hope it will help others.