A partir du SDK Flex 4 doc (link text):
« La largeur et hauteur par défaut d'un conteneur ViewStack est la largeur et la hauteur du premier enfant Un conteneur ViewStack ne change pas de taille à chaque fois que vous changez. . enfant actif
vous pouvez utiliser les techniques suivantes pour contrôler la taille d'un conteneur ViewStack afin qu'il affiche tous les composants à l'intérieur de ses enfants:
1. Set explicit width and height properties for all children to the same fixed values.
2. Set percentage-based width and height properties for all children to the same fixed values.
3. Set width and height properties for the ViewStack container to a fixed or percentage-based value.
la technique que vous utilisez est basé sur votre ap plication et le contenu de votre conteneur ViewStack. " Pour contourner cela, vous pouvez ajouter un scroller à l'intérieur du contenu du navigateur. Le code peut ressembler à ceci:
<?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" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:TabBar dataProvider="{myselfViewStack}"/>
<mx:ViewStack id="myselfViewStack" left="0" right="0" top="100" bottom="0">
<s:NavigatorContent>
<s:Scroller width="100%" height="100%">
<s:Group>
<!-- scrollbar not shown -->
<s:Group width="100%" height="100">
<s:Label text="1"/>
</s:Group>
</s:Group>
</s:Scroller>
</s:NavigatorContent>
<s:NavigatorContent>
<s:Scroller width="100%" height="100%">
<s:Group>
<!-- scrollbar shown -->
<!-- Explicit height set in group to "simulate" content -->
<s:Group width="100%" height="1500">
<s:Label text="2"/>
</s:Group>
</s:Group>
</s:Scroller>
</s:NavigatorContent>
<s:NavigatorContent>
<s:Label text="3"/>
</s:NavigatorContent>
</mx:ViewStack>
</s:Application>
J'ai besoin que les barres de défilement fonctionnent également avec d'autres vues. Donc, je dois définir la largeur et la hauteur ... Mais je ne connais pas la hauteur totale ... – chchrist
J'ai édité la réponse –
Merci, le groupe au sein d'un groupe a résolu mon problème. –