Flex中TabNavigator設(shè)置Tabs樣式思路及源碼
1、設(shè)計(jì)思路
(1)設(shè)計(jì)一個(gè)TabNavigator,其中包含兩個(gè)Tabs;
(2)設(shè)置Tabs樣式
2、設(shè)計(jì)源碼
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]
//學(xué)生數(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="學(xué)生" 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="學(xué)號(hào)"/>
</mx:horizontalAxis>
<mx:series>
<mx:ColumnSeries displayName="數(shù)學(xué)成績(jī)" 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="工號(hào)"/>
</mx:horizontalAxis>
<mx:series>
<mx:ColumnSeries displayName="教師評(píng)分" 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è)計(jì)說(shuō)明
(1)tab-style-name:設(shè)置所有tabs的樣式類
(2)first-tab-style-name:設(shè)置第一個(gè)tabs的樣式類
(3)last-tab-style-name:設(shè)置最后一個(gè)tabs的樣式類
(4)selected-tab-text-style-name:設(shè)置選中的tabs中的text樣式類
4、設(shè)計(jì)結(jié)果
(1)初始化時(shí)結(jié)果
(2)切換tabs
上一篇:Flex打開(kāi)新窗口將主窗口數(shù)據(jù)傳給子窗口然后返回
欄 目:Flex
下一篇:Flex中通過(guò)RadioButton進(jìn)行切換示例代碼
本文標(biāo)題:Flex中TabNavigator設(shè)置Tabs樣式思路及源碼
本文地址:http://www.jygsgssxh.com/a1/Flex/11594.html
您可能感興趣的文章
- 01-11flex調(diào)用webservice中的自定義類的方法
- 01-11Flex實(shí)現(xiàn)的上傳攝像頭拍照并將UI保存為圖片
- 01-11Flex字體加粗問(wèn)題只能對(duì)英文的字體加粗
- 01-11flex利用webservice上傳照片實(shí)現(xiàn)代碼
- 01-11Flex控制彈出窗口拖動(dòng)范圍示例代碼
- 01-11flex內(nèi)嵌html網(wǎng)頁(yè)示例代碼
- 01-11Flex中在Tree綁定數(shù)據(jù)后自動(dòng)展開(kāi)樹(shù)節(jié)點(diǎn)的方法
- 01-11Flex彈出窗口請(qǐng)求Action函數(shù)示例
- 01-11Flex中通過(guò)RadioButton進(jìn)行切換示例代碼
- 01-11Flex打開(kāi)新窗口將主窗口數(shù)據(jù)傳給子窗口然后返回


閱讀排行
- 1C語(yǔ)言 while語(yǔ)句的用法詳解
- 2java 實(shí)現(xiàn)簡(jiǎn)單圣誕樹(shù)的示例代碼(圣誕
- 3利用C語(yǔ)言實(shí)現(xiàn)“百馬百擔(dān)”問(wèn)題方法
- 4C語(yǔ)言中計(jì)算正弦的相關(guān)函數(shù)總結(jié)
- 5c語(yǔ)言計(jì)算三角形面積代碼
- 6什么是 WSH(腳本宿主)的詳細(xì)解釋
- 7C++ 中隨機(jī)函數(shù)random函數(shù)的使用方法
- 8正則表達(dá)式匹配各種特殊字符
- 9C語(yǔ)言十進(jìn)制轉(zhuǎn)二進(jìn)制代碼實(shí)例
- 10C語(yǔ)言查找數(shù)組里數(shù)字重復(fù)次數(shù)的方法
本欄相關(guān)
- 01-11flex調(diào)用webservice中的自定義類的方法
- 01-11Flex實(shí)現(xiàn)的上傳攝像頭拍照并將UI保存
- 01-11datagrid不可編輯行有關(guān)問(wèn)題的控制方法
- 01-11Flex控制彈出窗口拖動(dòng)范圍示例代碼
- 01-11flex利用webservice上傳照片實(shí)現(xiàn)代碼
- 01-11Flex字體加粗問(wèn)題只能對(duì)英文的字體加
- 01-11Flex中在Tree綁定數(shù)據(jù)后自動(dòng)展開(kāi)樹(shù)節(jié)點(diǎn)
- 01-11flex內(nèi)嵌html網(wǎng)頁(yè)示例代碼
- 01-11Flex中通過(guò)RadioButton進(jìn)行切換示例代碼
- 01-11Flex彈出窗口請(qǐng)求Action函數(shù)示例
隨機(jī)閱讀
- 01-11ajax實(shí)現(xiàn)頁(yè)面的局部加載
- 01-10SublimeText編譯C開(kāi)發(fā)環(huán)境設(shè)置
- 04-02jquery與jsp,用jquery
- 08-05織夢(mèng)dedecms什么時(shí)候用欄目交叉功能?
- 08-05dedecms(織夢(mèng))副欄目數(shù)量限制代碼修改
- 01-10使用C語(yǔ)言求解撲克牌的順子及n個(gè)骰子
- 08-05DEDE織夢(mèng)data目錄下的sessions文件夾有什
- 01-10delphi制作wav文件的方法
- 01-10C#中split用法實(shí)例總結(jié)
- 01-11Mac OSX 打開(kāi)原生自帶讀寫NTFS功能(圖文


