ITeye博客

给tab选项卡加上icon

hanyiduo · 2008-12-09 16:42 · Flex · Markdown


<?xml version="1.0" encoding="utf-8"?> 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
        layout="vertical" 
        verticalAlign="middle" 
        backgroundColor="white"> 
  
    <mx:Script> 
        <![cdata[ 
            [bindable] 
            [embed(source="assets/bulletCheck.png")] 
            private var BulletCheck:Class; 
  
            [bindable] 
            [embed(source="assets/bulletWarning.png")] 
            private var BulletWarning:Class; 
  
            [bindable] 
            [embed(source="assets/bulletCritical.png")] 
            private var BulletCritical:Class; 
        ]]> 
    </mx:Script> 
  
    <mx:VBox id="box" width="400" verticalGap="0"> 
        <mx:TabBar id="tabBar" 
                direction="horizontal" 
                dataProvider="{viewStack}" 
                width="100%" /> 
  
        <mx:ViewStack id="viewStack" 
                width="100%" 
                height="100" 
                backgroundColor="white" 
                borderSides="left bottom right" 
                borderStyle="solid" 
                borderThickness="1"> 
  
            <mx:Canvas id="child1" 
                    label="Success" 
                    icon="{BulletCheck}"> 
                <mx:Label text="one" /> 
            </mx:Canvas> 
  
            <mx:Canvas id="child2" 
                    label="Warning" 
                    icon="{BulletWarning}"> 
                <mx:Label text="two" /> 
            </mx:Canvas> 
  
            <mx:Canvas id="child3" 
                    label="Error" 
                    icon="{BulletCritical}"> 
                <mx:Label text="three" /> 
            </mx:Canvas> 
  
        </mx:ViewStack> 
    </mx:VBox> 
  
</mx:Application>


评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。