我要使用HDividedBox,我已经调整了问题。 实际上,当我减小手风琴组件的宽度时,列表不会减少。 在下面找到我的代码
<mx:HDividedBox width="100%"
height="100%"
color="0x323232">
<mx:Accordion width="40%" height="100%" >
<s:NavigatorContent width="100%" label="Courriers">
<s:List id="liCourriers" borderVisible="false"
width="100%"
change="itemCOIndexChangeHandler(event)" dataProvider="{DP_PAT_COURR}">
</s:List>
</s:NavigatorContent>
<s:NavigatorContent width="100%" height="100%" label="Courriers Images">
</s:NavigatorContent>
<s:NavigatorContent width="100%" height="100%" label="Docs Entrant">
</s:NavigatorContent>
</mx:Accordion>
<mx:HTML height="100%"
width="60%"
id="coContent"
borderVisible="true"
>
</mx:HTML>
</mx:HDividedBox>
感谢您的帮助
答案 0 :(得分:0)
尝试将列表和NavigatorContent的高度设置为100%。
对不起我之前的回复。事实上我误读了WIDTH这个词作为身高:( 我试图重现这个问题,并发现在特定级别,列表不会再缩小。
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="onCreationComplete(event)">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
protected function onCreationComplete(event:FlexEvent):void
{
var coll:ArrayCollection = new ArrayCollection();
for(var i:int; i < 1000; i++)
{
coll.addItem(i.toString() + 'Some lengthy string need to be attached.');
}
liCourriers.dataProvider = coll;
}
]]>
</fx:Script>
<mx:HDividedBox width="100%"
height="100%"
color="0x323232">
<mx:Accordion id="accordion" width="40%" height="100%" >
<s:NavigatorContent id="nc" width="100%" label="Courriers">
<s:List id="liCourriers" borderVisible="false"
width="100%">
</s:List>
</s:NavigatorContent>
<s:NavigatorContent width="100%" height="100%" label="Courriers Images">
</s:NavigatorContent>
<s:NavigatorContent width="100%" height="100%" label="Docs Entrant">
</s:NavigatorContent>
</mx:Accordion>
<s:Panel title="Panel" width="100%">
<s:layout>
<s:VerticalLayout paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10"/>
</s:layout>
<s:Label text="{'Accordion width: '+accordion.width}" width="100%"/>
<s:Label text="{'Navigator Content width: '+nc.width}" width="100%"/>
<s:Label text="{'List width: '+liCourriers.width}" width="100%"/>
<mx:HTML height="100%"
width="60%"
id="coContent"
borderVisible="true"
>
</mx:HTML>
</s:Panel>
</mx:HDividedBox>
</s:WindowedApplication>