0

I put a FormItem in a Form like below.

<mx:Form width="100%">
            <mx:FormItem label="Context Aware" width="100%" backgroundColor="red">
                <editorControls:CheckBox/>
            </mx:FormItem>
        </mx:Form>

There's gap between the actual content height and the form item boundary. Any idea on how to strictly fit the FormItem height to content?

This is Image:

enter image description here

Santhosh Nayak
  • 2,312
  • 3
  • 35
  • 65

1 Answers1

0

The checkbox is actually a button with an image overlaid on it, as an icon. The icon is a box with some whitespace, as an image. You will have to create a new image which does not have whitespace, and replace the current icon. Remember that this applies to downstate and so on, so you will need a series of similar images. (cf., Adobe's Button docs example).

Of course, you will also have to set verticalGap and indicatorGap as well as paddingTop to 0, on the CheckBox, FormItem, and Form. (cf., Adobe's Flex help on Form, FormHeading, and FormItem layout containers, the section titled "Laying out forms").

Here is some sample code:

<mx:Form width="100%" backgroundColor="0x0000ff" verticalGap="0" paddingTop="0" indicatorGap="0">
    <mx:FormItem label="Context Aware" width="100%" backgroundColor="0x00ff00"  verticalGap="0" paddingTop="0" indicatorGap="0">
        <mx:CheckBox  verticalGap="0" paddingTop="0" icon="@Embed('cbIcon.gif')"/>
    </mx:FormItem>
</mx:Form>

(If the answer is wrong, please let me know. If it is right, please check it as "correct".)

iND
  • 2,663
  • 1
  • 16
  • 36