flex 学习篇 ---- 导航类容器

 
 

导航类容器需要使用<mx:ViewStack />。可以直接从ui设计器中拉控件过去舞台或者手动敲代码。

导航类容器就是相当于创建了一个菜单,然后按每个选项都可以进入到不同的页面。

  1. 创建了<mx:ViewStack>之后需要为它指定id号。
    <mx:ViewStack id="viewstack1" x="343" y="237" width="264" height="223">
  2. 导航里面的每个页面都需要包含在各自的<s:NavigatorContent>中。
     1   <s:NavigatorContent width="100%" height="100%" label="视图 1">
    2 <s:CheckBox x="105" y="93" label="复选框"/>
    3 </s:NavigatorContent>
    4 <s:NavigatorContent width="100%" height="100%" label="ff">
    5 <s:Panel x="14" y="13" width="250" height="200">
    6 </s:Panel>
    7 </s:NavigatorContent>
    8 <s:NavigatorContent width="100%" height="100%" label="ss">
    9 <s:Button x="118" y="88" label="按钮"/>
    10 </s:NavigatorContent>
    </mx:ViewStack>
  3. 页面创建好了之后,就需要创建按钮给用户提供切换页面的选项。使用到了<s:ButtonBar>,需要为该类提供ViewStack类的ID号。该ButtonBar类需要放在Application类和ViewStack类之间。
    1 <s:Application>
    2 ........
    3 <s:ButtonBar y="229" left="364" width="206" dataProvider="{viewstack1}"/>
    4 <mx:ViewStack id="viewstack1">
    5 ............




 

转载于:https://www.cnblogs.com/pandaXiong/archive/2012/02/12/2348052.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值