0

幅 200px の Form オブジェクトと幅 100% の FormItem 子がある場合、非常に大きな子要素が含まれている場合、FormItem は親の幅 200px によって制限されているようには見えません。なんで?どうすればこれを止めることができますか?

<mx:Form width="200" backgroundColor="red">
    <mx:FormItem label="Field:" width="100%" backgroundColor="yellow">
        <!-- This component will force the FormItem to grow larger than the form... -->
        <mx:ComboBox>
            <mx:dataProvider>
                <mx:ArrayCollection>
                    <mx:String>A very, very long string which will force the form to expand</mx:String>
                </mx:ArrayCollection>
            </mx:dataProvider>
        </mx:ComboBox>
    </mx:FormItem>          
</mx:Form>  

(私は実際に、通常のサイズになる ComboBox のバージョンを作成しようとしていますが、親に対して大きすぎる場合は、幅 100% にスナップしてテキストを切り捨てます)

4

1 に答える 1

1

minWidth=0およびpercentWidth=100を設定すると、ComboBoxはその親のディメンションを尊重します。

于 2012-12-27T23:18:55.240 に答える