Is there a way to change the space between a spark form item and its content(textinput, conbobox)? I already set to 0 the "gap" property of the form, but still there is a lot of vertical space left between the form inputs.
5 Answers
Set the gap to -14 to get no gap between the items
<s:Form>
<s:layout>
<s:FormLayout gap="-14"/>
</s:layout>
<s:FormItem .....>
</s:Form>

- 926
- 8
- 17
The spark skin for formItem has left/right variables set based on "columns." I.e. left="column1:10" means the element is 10 pixels to the right of column 1.
So, create the skin, reduce those numbers in the "content" column area and check it.
Reducing all those numbers and the gap should tighten, along with setting the gap in form layout.

- 7,588
- 1
- 18
- 26
-
Where can i find the original skin, so i can customize it? thanx – hendrix Feb 14 '12 at 16:54
-
1It's in the SDK, the source is available here: http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4.6 – Jonathan Rowny Feb 14 '12 at 17:37
If you want to change the vertical gap between each Spark Form Item, create a custom skin based on FormSkin and change the gap property FormLayout.
If you want to change the horizontal gap between skin parts (labelDisplay, indicatorDisplay, helpContentGroup, ...), you need to create a custom skin based on FormItemSkin and change the ConstraintColumn values

- 8,822
- 4
- 37
- 50
-
thanks, Florian. I know about the gap property, but this only changes space between formItemn containers.. I need to change the space between the form item container border and its actual content (textboxes, dropdowns). – cili Feb 28 '11 at 16:29
I changed in my custom FormItem skin as followed, and it worked for me:
before:
<s:ConstraintRow id="row1" baseline="maxAscent:10" height="100%"/>
after:
<s:ConstraintRow id="row1" baseline="maxAscent:0" height="100%"/>

- 21
- 1
There are no paddingLeft, paddingRight etc. properties in FormItemLayout yet.

- 118,037
- 53
- 300
- 385

- 9,416
- 14
- 78
- 129