簡體   English   中英

flex4如何設置Panel的標題樣式?

[英]flex4 how to set style of a Panel's Title?

在flex4中如何設置Panel的標題樣式? 例如,如何將標題對齊設置為居中? 任何建議都會有幫助。 提前致謝。

您只需為面板定義一個新外觀並更改其中的textAlign屬性。

在此輸入圖像描述

<?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">

<s:Panel 
    width="200" height="150" 
    left="40" top="40" 
    title="This is my panel" 
    skinClass="assets.skins.MyPanelSkin"/>

</s:Application>

在您的皮膚文件中,您需要找到此塊:

    <!-- layer 3: text -->
    <!--- @copy spark.components.Panel#titleDisplay -->
    <s:Label id="titleDisplay" maxDisplayedLines="1"
    left="9" right="3" top="1" bottom="0" minHeight="30"
    verticalAlign="middle" textAlign="start" fontWeight="bold">
    </s:Label>

並改變

textAlign="start"

textAlign="center"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM