婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > Flex中TabNavigator設置Tabs樣式思路及源碼

Flex中TabNavigator設置Tabs樣式思路及源碼

熱門標簽:地圖標注多家店 外呼系統號碼顯示 天津企業外呼系統代理商 車載電話機器人 南昌crm外呼系統如何 廣州ai外呼系統業務 無錫電銷外呼系統代理 中山外呼系統中間件 什么行業需要電話機器人
1、設計思路

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

(2)設置Tabs樣式

2、設計源碼

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]
//學生數據綁定
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]
//教師數據綁定
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="數學成績" 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、設計說明

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

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

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

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

4、設計結果

(1)初始化時結果
 
(2)切換tabs
您可能感興趣的文章:
  • JS判斷瀏覽器之Navigator對象
  • javascript宿主對象之window.navigator詳解
  • JavaScript中的Navigator瀏覽器對象
  • 微信小程序 wxapp導航 navigator詳解
  • 微信小程序 navigator 組件實例詳解
  • javascript通過navigator.userAgent識別各種瀏覽器
  • javascript學習隨筆(編寫瀏覽器腳本 Navigator Scripting )
  • BOM之navigator對象和用戶代理檢測

標簽:攀枝花 海西 佛山 仙桃 滄州 呂梁 泰州 欽州

巨人網絡通訊聲明:本文標題《Flex中TabNavigator設置Tabs樣式思路及源碼》,本文關鍵詞  Flex,中,TabNavigator,設置,Tabs,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《Flex中TabNavigator設置Tabs樣式思路及源碼》相關的同類信息!
  • 本頁收集關于Flex中TabNavigator設置Tabs樣式思路及源碼的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 海南省| 桓台县| 祁阳县| 二连浩特市| 专栏| 游戏| 连城县| 定日县| 益阳市| 镇原县| 城固县| 襄汾县| 玉田县| 伊宁县| 华阴市| 农安县| 镇沅| 新乡市| 芮城县| 象山县| 五寨县| 油尖旺区| 保康县| 安岳县| 论坛| 南安市| 北票市| 乌鲁木齐市| 青岛市| 乡城县| 新余市| 双柏县| 安义县| 那坡县| 伊金霍洛旗| 神池县| 青龙| 廉江市| 岐山县| 勐海县| 息烽县|