欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Flex中TabNavigator設(shè)置Tabs樣式思路及源碼

 更新時間:2014年05月06日 10:36:32   作者:  
這篇文章主要介紹了Flex中TabNavigator如何設(shè)置Tabs樣式有哪些思路,感興趣的朋友可以看看下面的源碼
1、設(shè)計思路

(1)設(shè)計一個TabNavigator,其中包含兩個Tabs;

(2)設(shè)置Tabs樣式

2、設(shè)計源碼

Tabs.mxml:
復制代碼 代碼如下:

<?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"
width="100%" height="100%"
>
<fx:Declarations>
<!-- Define custom colors for use as fills. -->
<mx:SolidColor id="sc1" color="0xADFF2F" alpha=".8"/>
<mx:SolidColor id="sc2" color="0xADD8E6" alpha=".6"/>

<!-- Define custom Strokes for the columns. -->
<mx:SolidColorStroke id="s1" color="0xADFF2F" weight="2"/>
<mx:SolidColorStroke id="s2" color="0xADD8E6" weight="2"/>
</fx:Declarations>

<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
.myTabs{
color:#FFFFFF;
font-weight:bold;
background-color:#6495ED;
}
.myTextTabs{
color:#8B0000;
background-color:#97FFFF;
font-weight:bold;
}
mx|TabNavigator{
tab-style-name:"myTabs";
first-tab-style-name:"myTabs";
last-tab-style-name:"myTabs";
selected-tab-text-style-name:"myTextTabs";
}
</fx:Style>

<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;

[Bindable]
//學生數(shù)據(jù)綁定
private var studentArray:ArrayCollection = new ArrayCollection([
{sno:"2013010101",math:"96"},
{sno:"2013010102",math:"89"},
{sno:"2013010103",math:"87"},
{sno:"2013010104",math:"90"},
{sno:"2013010105",math:"78"},
{sno:"2013010106",math:"69"},
{sno:"2013010107",math:"92"},
{sno:"2013010108",math:"80"},
{sno:"2013010109",math:"60"},
{sno:"2013010110",math:"89"}
]);

[Bindable]
//教師數(shù)據(jù)綁定
private var teacherArray:ArrayCollection = new ArrayCollection([
{tno:"2013010101",tscore:"96"},
{tno:"2013010102",tscore:"99"},
{tno:"2013010103",tscore:"77"},
{tno:"2013010104",tscore:"70"},
{tno:"2013010105",tscore:"98"},
{tno:"2013010106",tscore:"79"},
{tno:"2013010107",tscore:"82"},
{tno:"2013010108",tscore:"70"},
{tno:"2013010109",tscore:"80"},
{tno:"2013010110",tscore:"79"}
]);
]]>
</fx:Script>

<mx:VBox width="100%" height="100%" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10">
<mx:TabNavigator width="100%" height="100%" fontSize="12" cornerRadius="8">
<s:NavigatorContent label="學生" width="100%" height="100%">
<mx:VBox width="100%" height="100%" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10">
<mx:ColumnChart id="column" dataProvider="{studentArray}" showDataTips="true" width="100%" height="100%" fontSize="12">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="sno" displayName="學號"/>
</mx:horizontalAxis>
<mx:series>
<mx:ColumnSeries displayName="數(shù)學成績" xField="sno" yField="math" fill="{sc1}" stroke="{s1}"/>
</mx:series>
</mx:ColumnChart>
<mx:HBox width="100%" height="30">
<s:Label width="50%"/>
<mx:Legend dataProvider="{column}"/>
</mx:HBox>
</mx:VBox>

</s:NavigatorContent>
<s:NavigatorContent label="教師" width="100%" height="100%" fontSize="12">
<mx:VBox width="100%" height="100%" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10">
<mx:ColumnChart id="column1" dataProvider="{teacherArray}" showDataTips="true" width="100%" height="100%" fontSize="12">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="tno" displayName="工號"/>
</mx:horizontalAxis>
<mx:series>
<mx:ColumnSeries displayName="教師評分" xField="tno" yField="tscore" fill="{sc2}" stroke="{s2}"/>
</mx:series>
</mx:ColumnChart>
<mx:HBox width="100%" height="30">
<s:Label width="50%"/>
<mx:Legend dataProvider="{column1}"/>
</mx:HBox>
</mx:VBox>
</s:NavigatorContent>
</mx:TabNavigator>
</mx:VBox>
</s:Application>

3、設(shè)計說明

(1)tab-style-name:設(shè)置所有tabs的樣式類

(2)first-tab-style-name:設(shè)置第一個tabs的樣式類

(3)last-tab-style-name:設(shè)置最后一個tabs的樣式類

(4)selected-tab-text-style-name:設(shè)置選中的tabs中的text樣式類

4、設(shè)計結(jié)果

(1)初始化時結(jié)果
 
(2)切換tabs

相關(guān)文章

  • Flex DataGrid自動編號示例

    Flex DataGrid自動編號示例

    這篇文章主要介紹了Flex DataGrid如何自動編號,感興趣的朋友可以參考下
    2014-05-05
  • FLEX HashMap遍歷并取到需要的值

    FLEX HashMap遍歷并取到需要的值

    在項目用到了HashMap,需要遍歷,并取到需要的值,具體實現(xiàn)代碼如下,感興趣的朋友可以參考下哈
    2013-06-06
  • flex是什么 Flex介紹

    flex是什么 Flex介紹

    Flex 是一個高效、免費的開源框架,可用于構(gòu)建具有表現(xiàn)力的 Web 應用程序,這些應用程序利用 Adobe Flash Player和 Adobe AIR, 運行時跨瀏覽器、桌面和操作系統(tǒng)實現(xiàn)一致的部署
    2013-01-01
  • Flex中的HDividedBox和VDividedBox的比較附圖

    Flex中的HDividedBox和VDividedBox的比較附圖

    學習Flex的朋友對HDividedBox和VDividedBox并不陌生吧,下面是兩者的簡單比較,感興趣的朋友可以參考下
    2013-10-10
  • flex復選框和下拉列表的幾種用法整理

    flex復選框和下拉列表的幾種用法整理

    自己閑暇時間整理了有關(guān)復選框可下拉的幾種用法,在這里與大家分享下,感興趣的朋友可以參考下哈,希望對大家有所幫助
    2013-07-07
  • flex tomcat端口被占用的問題分析及解決方法

    flex tomcat端口被占用的問題分析及解決方法

    在啟動Tomcat,提示8080端口被占用了,該如何解決呢?本文整理了一些修改方法,感興趣的朋友可以參考下,希望可以幫助到你
    2013-02-02
  • FLEX 獲取DataGrid行號和列號示例代碼

    FLEX 獲取DataGrid行號和列號示例代碼

    獲取DataGrid行號和列號在使用過程中還是蠻實用的,下面為大家詳細介紹下FLEX是如何做到的,感興趣的朋友可以了解下
    2013-09-09
  • 全面了解flex的用途

    全面了解flex的用途

    下面小編就為大家?guī)硪黄媪私鈌lex的用途。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2016-06-06
  • Flex tree加虛線顯示效果并且替代原始圖標

    Flex tree加虛線顯示效果并且替代原始圖標

    Flex tree修改默認圖標并且加虛線顯示效果,實在是看不下去那種巨丑無比的小箭頭+文件夾的顯示方式,具體實現(xiàn)如下,有此需求的朋友可以參考下,希望對家有所幫助
    2013-08-08
  • Flex中對表格中某列的值進行數(shù)字格式化保留兩位小數(shù)

    Flex中對表格中某列的值進行數(shù)字格式化保留兩位小數(shù)

    表格中展示的比率,對比率的處理是:保留兩位小數(shù),并向上保留。通過對某列的值進行數(shù)字格式化來實現(xiàn)保留兩位小數(shù)
    2014-10-10

最新評論