10 Replies Latest reply on Dec 20, 2010 9:42 AM by saisri2k2

    BorderContainer

    Zolotoj Level 3

      can I specify its height using a percent?

        • 1. Re: BorderContainer
          Lee Burrows Level 4

          BorderContainer inherits from UIComponent so yes, you can specify height as a percentage - just like for any other container such as Group, SkinnableContainer etc

          • 2. Re: BorderContainer
            Zolotoj Level 3

            I tried, does not look like it follows it. While height="50" works fine.

            • 3. Re: BorderContainer
              Lee Burrows Level 4

              it should work - can you post your code?

              • 4. Re: BorderContainer
                Zolotoj Level 3

                Its' something like this:

                <s:BorderContainer height="10%"/>

                No matter what I specify the height keeps the same.

                • 5. Re: BorderContainer
                  Lee Burrows Level 4

                  hmm, it must be something to do with your layout. this basic sample works fine:

                   

                  <?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">

                   

                   

                  <s:BorderContainer width="50%" height="50%" />

                   

                   

                  </s:Application>

                   

                  whats inside the BorderContainer and what is its parent?

                  • 6. Re: BorderContainer
                    saisri2k2 Level 4

                    it completely depends on the parent container holding the bordrecontainer, see if you have any other components which are invisible but included in layout around the BC. try specifying the height and width as well. If the container has components around it with fixed height width then there could b problems.. if atleast one container is specified in %, specify all other containers as %s as well.

                    • 7. Re: BorderContainer
                      Zolotoj Level 3

                      Here is more code:

                      <?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" 
                                        >     
                           <s:layout>
                                <s:HorizontalLayout horizontalAlign="center"/>
                           </s:layout>
                      <s:BorderContainer width="75%" height="75%" borderVisible="true"
                                                  borderWeight="0" dropShadowVisible="true">
                                <s:layout>
                                     <s:VerticalLayout verticalAlign="top" horizontalAlign="center" gap="0"/>
                                </s:layout>
                                <s:BorderContainer width="100%" height="1%" backgroundColor="#F6D989">     
                                     <s:layout>
                                          <s:VerticalLayout verticalAlign="middle" paddingLeft="10"/>
                                     </s:layout>
                      .....
                      

                      So, this 1% does nothing ....

                      • 8. Re: BorderContainer
                        saisri2k2 Level 4

                        Can you post the child nodes of the 1%container? or complete mxml will help us to debug

                        • 9. Re: BorderContainer
                          Zolotoj Level 3

                          Here:

                          <s:BorderContainer width="75%" height="75%" borderVisible="true"
                                                      borderWeight="0" dropShadowVisible="true">
                                    <s:layout>
                                         <s:VerticalLayout verticalAlign="top" horizontalAlign="center" gap="0"/>
                                    </s:layout>
                                    <s:BorderContainer width="100%" height="56" backgroundColor="#F6D989">     
                                         <s:layout>
                                              <s:VerticalLayout verticalAlign="middle" paddingLeft="10"/>
                                         </s:layout>
                                         <s:BorderContainer x="101" width="350" height="40" cornerRadius="20">
                                              <s:layout>
                                                   <s:VerticalLayout verticalAlign="middle" paddingLeft="10"/>
                                              </s:layout>
                                              <s:HGroup verticalAlign="middle">
                                                   <s:ComboBox id="files" labelField="filenumber">                              
                                                   </s:ComboBox>
                                                   <s:BorderContainer height="28" backgroundColor="#C0C0C0" borderVisible="true" width="150">
                                                        <s:layout>
                                                             <s:HorizontalLayout verticalAlign="middle" paddingLeft="2" gap="2"/>
                                                        </s:layout>
                                                        <s:BorderContainer borderStyle="solid" width="27" height="24" 
                                                                               borderVisible="true">
                                                             <s:layout>
                                                                  <s:HorizontalLayout verticalAlign="middle" horizontalAlign="center"/>
                                                             </s:layout>
                                                             <s:Image width="22" height="21" id="open" mouseOver="onImageMouseOver(event)" 
                                                                        mouseOut="onImageMouseOut(event)" toolTip="Open" click="openFile()"
                                                                        source="@Embed(source='D:/testarea/projects/assets/open.png')">                                                  
                                                             </s:Image>     
                                                        </s:BorderContainer>
                                                        <s:BorderContainer borderStyle="solid" width="26" height="24" 
                                                                               borderVisible="true">
                                                             <s:layout>
                                                                  <s:HorizontalLayout verticalAlign="middle" horizontalAlign="center"/>
                                                             </s:layout>
                                                                  <s:Image width="22" height="20" mouseOver="onImageMouseOver(event)" 
                                                                             mouseOut="onImageMouseOut(event)" toolTip="Browse"
                                                                        source="@Embed(source='D:/testarea/projects/assets/browse.png')"/>
                                                        </s:BorderContainer>     
                                                        <s:BorderContainer borderStyle="solid" width="26" height="24"
                                                                               borderVisible="true">
                                                             <s:layout>
                                                                  <s:HorizontalLayout verticalAlign="middle" horizontalAlign="center"/>
                                                             </s:layout>
                                                             <s:Image width="22" height="20" mouseOver="onImageMouseOver(event)" 
                                                                        mouseOut="onImageMouseOut(event)" toolTip="Delete"
                                                                   source="@Embed(source='D:/testarea/projects/assets/delete.png')"/>
                                                        </s:BorderContainer>
                                                        <s:BorderContainer borderStyle="solid" width="26" height="24"
                                                                               borderVisible="true">
                                                             <s:layout>
                                                                  <s:HorizontalLayout verticalAlign="middle" horizontalAlign="center"/>
                                                             </s:layout>
                                                             <s:Image width="22" height="20" mouseOver="onImageMouseOver(event)" 
                                                                        mouseOut="onImageMouseOut(event)" toolTip="New File"
                                                                        source="@Embed(source='D:/testarea/projects/assets/new.png')"/>
                                                        </s:BorderContainer>
                                                        <s:BorderContainer borderStyle="solid" width="26" height="24"
                                                                               borderVisible="true">
                                                             <s:layout>
                                                                  <s:HorizontalLayout verticalAlign="middle" horizontalAlign="center"/>
                                                             </s:layout>
                                                             <s:Image width="22" height="20" mouseOver="onImageMouseOver(event)" 
                                                                        mouseOut="onImageMouseOut(event)" toolTip="Save"
                                                                        source="@Embed(source='D:/testarea/projects/assets/save.png')"/>
                                                        </s:BorderContainer>
                                                   </s:BorderContainer>     
                                              </s:HGroup>
                                         </s:BorderContainer>
                                    </s:BorderContainer>
                                    <mx:ViewStack width="100%" height="90%" selectedIndex="0" borderVisible="true" 
                                                     borderStyle="solid" id="stock">
                                         <s:NavigatorContent width="100%" height="100%" label="blank">
                                         </s:NavigatorContent>
                                         <s:NavigatorContent width="100%" height="100%" label="details" backgroundColor="#F6F2B7">
                                         </s:NavigatorContent>
                                         <s:NavigatorContent width="100%" height="100%" label="list" backgroundColor="#D7EBEF">
                                         </s:NavigatorContent>               
                                    </mx:ViewStack>
                               </s:BorderContainer>     
                          
                          
                          • 10. Re: BorderContainer
                            saisri2k2 Level 4

                            Within the container you have a lot of other containers whch have height and widths hard coded, that is the problem, if you make them as %s then it would work. use scrollers immediately below the parent container where you specified 1%, you will see the difference. the whole purupose is to make the container invisible? if so, try states?