Flex 导航学习笔记
2012-02-17 19:55
330 查看
一段时间没有学flex 来,今天把看到的笔记都记录下来。是一些导航的使用,可以尝试运行一下。感觉还不错
ViewStack的使用
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:ViewStack id="boxstack">
<mx:VBox id="red" label="redbox" width="150" height="150" backgroundColor ="#FF0000"/>
<mx:VBox id="green" label="greenbox" width="150" height="150" backgroundColor="#00FF00"/>
<mx:VBox id="blue" label="bluebox" width="150" height="150" backgroundColor="#0000FF"/>
</mx:ViewStack>
<mx:HBox >
<mx:Button label="redbox" click="boxstack.selectedIndex=0"/>
<mx:Button label="greenbox" click="boxstack.selectedIndex=1"/>
<mx:Button label="bluebox" click="boxstack.selectedIndex=2"/>
</mx:HBox>
</mx:Application>
LinkBar 的使用
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:ViewStack id="boxstack">
<mx:VBox id="red" label="redbox" width="150" height="150" backgroundColor ="#FF0000"/>
<mx:VBox id="green" label="greenbox" width="150" height="150" backgroundColor="#00FF00"/>
<mx:VBox id="blue" label="bluebox" width="150" height="150" backgroundColor="#0000FF"/>
</mx:ViewStack>
<!--<mx:HBox >
<mx:Button label="redbox" click="boxstack.selectedIndex=0"/>
<mx:Button label="greenbox" click="boxstack.selectedIndex=1"/>
<mx:Button label="bluebox" click="boxstack.selectedIndex=2"/>
</mx:HBox>-->
<mx:LinkBar dataProvider="{boxstack}"/>
</mx:Application>
TabBar的使用
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:TabBar dataProvider="{boxstack}"/>
<mx:ViewStack id="boxstack">
<mx:VBox id="red" label="redbox" width="150" height="150" backgroundColor ="#FF0000"/>
<mx:VBox id="green" label="greenbox" width="150" height="150" backgroundColor="#00FF00"/>
<mx:VBox id="blue" label="bluebox" width="150" height="150" backgroundColor="#0000FF"/>
</mx:ViewStack>
<!--<mx:HBox >
<mx:Button label="redbox" click="boxstack.selectedIndex=0"/>
<mx:Button label="greenbox" click="boxstack.selectedIndex=1"/>
<mx:Button label="bluebox" click="boxstack.selectedIndex=2"/>
</mx:HBox>-->
</mx:Application>
ButtonBar的使用
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:ButtonBar dataProvider="{boxstack}"/>
<mx:ViewStack id="boxstack">
<mx:VBox id="red" label="redbox" width="150" height="150" backgroundColor ="#FF0000"/>
<mx:VBox id="green" label="greenbox" width="150" height="150" backgroundColor="#00FF00"/>
<mx:VBox id="blue" label="bluebox" width="150" height="150" backgroundColor="#0000FF"/>
</mx:ViewStack>
<!--<mx:HBox >
<mx:Button label="redbox" click="boxstack.selectedIndex=0"/>
<mx:Button label="greenbox" click="boxstack.selectedIndex=1"/>
<mx:Button label="bluebox" click="boxstack.selectedIndex=2"/>
</mx:HBox>-->
</mx:Application>
ToggleButtonBar的使用
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:ToggleButtonBar dataProvider="{boxstack}"/>
<mx:ViewStack id="boxstack">
<mx:VBox id="red" label="redbox" width="150" height="150" backgroundColor ="#FF0000"/>
<mx:VBox id="green" label="greenbox" width="150" height="150" backgroundColor="#00FF00"/>
<mx:VBox id="blue" label="bluebox" width="150" height="150" backgroundColor="#0000FF"/>
</mx:ViewStack>
<!--<mx:HBox >
<mx:Button label="redbox" click="boxstack.selectedIndex=0"/>
<mx:Button label="greenbox" click="boxstack.selectedIndex=1"/>
<mx:Button label="bluebox" click="boxstack.selectedIndex=2"/>
</mx:HBox>-->
</mx:Application>
TabNavigator 的使用
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:TabNavigator width="300" >
<mx:VBox id="red" label="redbox" width="100%" height="150" backgroundColor ="#FF0000"/>
<mx:VBox id="green" label="greenbox" width="100%" height="150" backgroundColor="#00FF00"/>
<mx:VBox id="blue" label="bluebox" width="100%" height="150" backgroundColor="#0000FF"/>
</mx:TabNavigator>
<!--<mx:HBox >
<mx:Button label="redbox" click="boxstack.selectedIndex=0"/>
<mx:Button label="greenbox" click="boxstack.selectedIndex=1"/>
<mx:Button label="bluebox" click="boxstack.selectedIndex=2"/>
</mx:HBox>-->
</mx:Application>
Accordion 的使用
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Accordion width="300" >
<mx:VBox id="red" label="redbox" width="100%" height="150" backgroundColor ="#FF0000"/>
<mx:VBox id="green" label="greenbox" width="100%" height="150" backgroundColor="#00FF00"/>
<mx:VBox id="blue" label="bluebox" width="100%" height="150" backgroundColor="#0000FF"/>
</mx:Accordion>
<!--<mx:HBox >
<mx:Button label="redbox" click="boxstack.selectedIndex=0"/>
<mx:Button label="greenbox" click="boxstack.selectedIndex=1"/>
<mx:Button label="bluebox" click="boxstack.selectedIndex=2"/>
</mx:HBox>-->
</mx:Application>
ViewStack的使用
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:ViewStack id="boxstack">
<mx:VBox id="red" label="redbox" width="150" height="150" backgroundColor ="#FF0000"/>
<mx:VBox id="green" label="greenbox" width="150" height="150" backgroundColor="#00FF00"/>
<mx:VBox id="blue" label="bluebox" width="150" height="150" backgroundColor="#0000FF"/>
</mx:ViewStack>
<mx:HBox >
<mx:Button label="redbox" click="boxstack.selectedIndex=0"/>
<mx:Button label="greenbox" click="boxstack.selectedIndex=1"/>
<mx:Button label="bluebox" click="boxstack.selectedIndex=2"/>
</mx:HBox>
</mx:Application>
LinkBar 的使用
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:ViewStack id="boxstack">
<mx:VBox id="red" label="redbox" width="150" height="150" backgroundColor ="#FF0000"/>
<mx:VBox id="green" label="greenbox" width="150" height="150" backgroundColor="#00FF00"/>
<mx:VBox id="blue" label="bluebox" width="150" height="150" backgroundColor="#0000FF"/>
</mx:ViewStack>
<!--<mx:HBox >
<mx:Button label="redbox" click="boxstack.selectedIndex=0"/>
<mx:Button label="greenbox" click="boxstack.selectedIndex=1"/>
<mx:Button label="bluebox" click="boxstack.selectedIndex=2"/>
</mx:HBox>-->
<mx:LinkBar dataProvider="{boxstack}"/>
</mx:Application>
TabBar的使用
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:TabBar dataProvider="{boxstack}"/>
<mx:ViewStack id="boxstack">
<mx:VBox id="red" label="redbox" width="150" height="150" backgroundColor ="#FF0000"/>
<mx:VBox id="green" label="greenbox" width="150" height="150" backgroundColor="#00FF00"/>
<mx:VBox id="blue" label="bluebox" width="150" height="150" backgroundColor="#0000FF"/>
</mx:ViewStack>
<!--<mx:HBox >
<mx:Button label="redbox" click="boxstack.selectedIndex=0"/>
<mx:Button label="greenbox" click="boxstack.selectedIndex=1"/>
<mx:Button label="bluebox" click="boxstack.selectedIndex=2"/>
</mx:HBox>-->
</mx:Application>
ButtonBar的使用
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:ButtonBar dataProvider="{boxstack}"/>
<mx:ViewStack id="boxstack">
<mx:VBox id="red" label="redbox" width="150" height="150" backgroundColor ="#FF0000"/>
<mx:VBox id="green" label="greenbox" width="150" height="150" backgroundColor="#00FF00"/>
<mx:VBox id="blue" label="bluebox" width="150" height="150" backgroundColor="#0000FF"/>
</mx:ViewStack>
<!--<mx:HBox >
<mx:Button label="redbox" click="boxstack.selectedIndex=0"/>
<mx:Button label="greenbox" click="boxstack.selectedIndex=1"/>
<mx:Button label="bluebox" click="boxstack.selectedIndex=2"/>
</mx:HBox>-->
</mx:Application>
ToggleButtonBar的使用
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:ToggleButtonBar dataProvider="{boxstack}"/>
<mx:ViewStack id="boxstack">
<mx:VBox id="red" label="redbox" width="150" height="150" backgroundColor ="#FF0000"/>
<mx:VBox id="green" label="greenbox" width="150" height="150" backgroundColor="#00FF00"/>
<mx:VBox id="blue" label="bluebox" width="150" height="150" backgroundColor="#0000FF"/>
</mx:ViewStack>
<!--<mx:HBox >
<mx:Button label="redbox" click="boxstack.selectedIndex=0"/>
<mx:Button label="greenbox" click="boxstack.selectedIndex=1"/>
<mx:Button label="bluebox" click="boxstack.selectedIndex=2"/>
</mx:HBox>-->
</mx:Application>
TabNavigator 的使用
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:TabNavigator width="300" >
<mx:VBox id="red" label="redbox" width="100%" height="150" backgroundColor ="#FF0000"/>
<mx:VBox id="green" label="greenbox" width="100%" height="150" backgroundColor="#00FF00"/>
<mx:VBox id="blue" label="bluebox" width="100%" height="150" backgroundColor="#0000FF"/>
</mx:TabNavigator>
<!--<mx:HBox >
<mx:Button label="redbox" click="boxstack.selectedIndex=0"/>
<mx:Button label="greenbox" click="boxstack.selectedIndex=1"/>
<mx:Button label="bluebox" click="boxstack.selectedIndex=2"/>
</mx:HBox>-->
</mx:Application>
Accordion 的使用
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Accordion width="300" >
<mx:VBox id="red" label="redbox" width="100%" height="150" backgroundColor ="#FF0000"/>
<mx:VBox id="green" label="greenbox" width="100%" height="150" backgroundColor="#00FF00"/>
<mx:VBox id="blue" label="bluebox" width="100%" height="150" backgroundColor="#0000FF"/>
</mx:Accordion>
<!--<mx:HBox >
<mx:Button label="redbox" click="boxstack.selectedIndex=0"/>
<mx:Button label="greenbox" click="boxstack.selectedIndex=1"/>
<mx:Button label="bluebox" click="boxstack.selectedIndex=2"/>
</mx:HBox>-->
</mx:Application>
相关文章推荐
- Flex 导航控件学习笔记
- Flex 导航学习笔记
- Flex 导航学习笔记
- bootstrap菜单、按钮及导航学习笔记5-1
- flex学习笔记02 - WebORB
- bootstrap菜单、按钮及导航学习笔记5-18导航(基础样式)
- flex 入门学习笔记2 之popupbutten的使用
- flex 入门学习笔记3 之RadioButton和RadioButtonGroup
- flex&bison 学习笔记
- css3 flex属性flex-grow、flex-shrink、flex-basis学习笔记
- Flex解决“无法为区域设置“zh_CN”解析资源束“ViewerStrings””问题总结(学习笔记)
- css3 flex属性flex-grow、flex-shrink、flex-basis学习笔记
- flex 学习笔记
- Flex学习笔记(五)
- flex 学习笔记 正则表达式(二)
- FLEX学习笔记:mx.core.BitmapAsset ——位图的使用
- Java与Flex学习笔记(19)----Flex中的Session管理
- Flex学习笔记[1] - Flex 开发入门
- Flex 学习笔记 小知识汇总
- Hadoop学习笔记系列文章导航