簡體   English   中英

Flex FormItems不遵守表單寬度

[英]Flex FormItems don't honour Form width

當我有一個寬度為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%的寬度並截斷文本)

如果您設置minWidth = 0和percentWidth = 100,則ComboBox將遵守其父級的尺寸。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM