Flex的设计问题

时间:2012-08-22 18:11:54

标签: flex layout vbox

我正在使用Flex 3.0。我试图在一个TabNavigator中嵌套VBox,并且工作正常。但在我的第一个VBox中,我有两个按钮不能显示。无论如何,我对设计概念并不了解,也不熟悉Flex。我尝试使用Hbox搞乱宽度和高度属性。有人可以看看并弄清楚我可以做些什么来解决这些问题。这是完整的小组。 TabNavigator接近底部。

<mx:Panel id="pnlMain" label="Address Search" width="100%" borderStyle="none" headerHeight="0">
    <mx:ViewStack id="vsAddressSearch" resizeToContent="true">
        <mx:Form id="frmAddressSearch" styleName="measureForm" width="300" height="100%" fontFamily="Arial" fontSize="11" verticalGap="0" horizontalGap="0" verticalScrollPolicy="off" horizontalScrollPolicy="off">
            <mx:FormItem label="Address:" paddingBottom="5" paddingTop="5" textAlign="left" fontWeight="bold" width="100%">                
                <mx:TextInput width="100%" id="txtAddress" text=""/>            
            </mx:FormItem>  
            <mx:HRule height="5" width="100%"/> 
            <mx:HBox horizontalAlign="left" paddingTop="5">
                <mx:Button label="Find Address" click="BingFindAddress()"/>     
                <mx:Button label="Clear" click="clearGraphics()"/>  
            </mx:HBox>              
        </mx:Form>
        <mx:Form id="frmAddressSearch1" styleName="measureForm" width="100%" height="100%" fontFamily="Arial" fontSize="11" verticalGap="0" horizontalGap="0" verticalScrollPolicy="off" horizontalScrollPolicy="off">
            <mx:FormItem label="Street:" paddingBottom="5"  labelWidth="150" textAlign="left" fontWeight="bold">                
                <mx:TextInput width="100%" id="address" text=""/>            
            </mx:FormItem>            
            <mx:FormItem label="City:" paddingBottom="5" labelWidth="150" textAlign="left" fontWeight="bold">                
                <mx:TextInput width="100%" id="city" text=""/>            
            </mx:FormItem>   
            <mx:FormItem label="State/Province:" paddingBottom="5"  labelWidth="150" textAlign="left" fontWeight="bold">                
                <mx:TextInput width="100" id="state" text="PA"/>            
            </mx:FormItem>            
            <mx:FormItem label="ZIP Code or Postal Code:" fontWeight="bold" labelWidth="150"  textAlign="left" paddingBottom="5" >                
                <mx:TextInput width="100" id="zip" text=""/>            
            </mx:FormItem>            
            <mx:FormItem label="Country:" paddingBottom="5"  labelWidth="150" textAlign="left" fontWeight="bold">                  
                <mx:ComboBox id="country" selectedIndex="0">                    
                    <mx:ArrayCollection>     
                        <mx:String>USA</mx:String>                   
                        <mx:String>Canada</mx:String>                        
                        <mx:String>Mexico</mx:String>                    
                    </mx:ArrayCollection>                
                </mx:ComboBox>            
            </mx:FormItem>       
            <mx:HRule height="5" width="100%"/> 
            <mx:HBox horizontalAlign="left" paddingTop="5">
                <mx:Button label="Find Address" click="ESRIFindAddress()"/>     
                <mx:Button label="Clear" click="clearGraphics()"/>

            </mx:HBox>     
        </mx:Form>
        <mx:Form id="frmAddressSearch2" styleName="measureForm" width="100%" height="100%" fontFamily="Arial" fontSize="11" verticalGap="0" horizontalGap="0" verticalScrollPolicy="off" horizontalScrollPolicy="off">
            <mx:FormItem  label="Street:" paddingBottom="5"  labelWidth="150" textAlign="left" fontWeight="bold">                
                <mx:TextInput width="100%" id="bamAddress" text="273 Cumberland St"/>            
            </mx:FormItem>            
            <mx:FormItem  label="City:" paddingBottom="5" labelWidth="150" textAlign="left" fontWeight="bold">                
                <mx:TextInput width="100%" id="bamCity" text="Harrisburg"/>            
            </mx:FormItem>   
            <mx:FormItem  label="State/Province:" paddingBottom="5"  labelWidth="150" textAlign="left" fontWeight="bold">                
                <mx:TextInput width="100" id="bamState" text="PA"/>            
            </mx:FormItem>            
            <mx:FormItem  label="ZIP Code or Postal Code:" fontWeight="bold" labelWidth="150"  textAlign="left" paddingBottom="5" >                
                <mx:TextInput width="100" id="bamZip" text="17102"/>            
            </mx:FormItem>            
            <mx:FormItem label="Country:" paddingBottom="5"  labelWidth="150" textAlign="left" fontWeight="bold">                  
                <mx:ComboBox id="bamCountry" selectedIndex="0">                    
                    <mx:ArrayCollection>     
                        <mx:String>USA</mx:String>                   
                        <mx:String>Canada</mx:String>                        
                        <mx:String>Mexico</mx:String>                    
                    </mx:ArrayCollection>                
                </mx:ComboBox>            
            </mx:FormItem>       
            <mx:HRule height="5" width="100%"/> 
            <mx:HBox horizontalAlign="left" paddingTop="5">
                <mx:Button label="Find Address" click="BAMFindAddress()"/>     
                <mx:Button label="Clear" click="clearGraphics()"/>     
            </mx:HBox>     
        </mx:Form>
    </mx:ViewStack>
    <mx:VBox id="frmShell" backgroundAlpha=".7" backgroundColor="#dddddd" visible="false" left="0" top="0" width="100%" height="100%"></mx:VBox>
    <mx:Text id="hintLabel" fontSize="10" color="#999999" text="" horizontalCenter="0" bottom="10" visible="false" maxWidth="290" />

    <mx:TabNavigator id="tabNavigator" width="100%" height="0%"  visible="false" creationPolicy="auto">


        <mx:VBox id="generalInformation" label="Gen. Info." width="100%">
            <mx:Label id="ard" text=""> 
            </mx:Label>
            <mx:Button  id="googleButton" visible="false" label="Google Directions" click="newWin('https://maps.google.com/?q=' + addressResult)"/>
            <mx:Button id="mapquestButton" visible="false" label="MapQuest Directions" click="newWin('https://mapquest.com/?q=' + addressResult)"/>
        </mx:VBox>
        <mx:VBox id="schoolDistrict" label="School District" width="100%">
        </mx:VBox>
        <mx:VBox id="paHouse" label="PA House" width="100%">
        </mx:VBox>
        <mx:VBox id="paSenate" label="PA Senate" width="100%">
        </mx:VBox>
        <mx:VBox id="usHouse" label="US House" width="100%">
        </mx:VBox>
    </mx:TabNavigator>  
</mx:Panel>

1 个答案:

答案 0 :(得分:1)

您的按钮设置为visible="false",因此它们不会显示。

<mx:Button  id="googleButton" visible="false" label="Google Directions" click="newWin('https://maps.google.com/?q=' + addressResult)"/>
<mx:Button id="mapquestButton" visible="false" label="MapQuest Directions" click="newWin('https://mapquest.com/?q=' + addressResult)"/>