spark form item gap in Flex
Asked Answered
O

5

10

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.

Onesided answered 26/2, 2011 at 12:0 Comment(0)
T
12

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.

Tierell answered 6/5, 2011 at 18:15 Comment(2)
Where can i find the original skin, so i can customize it? thanxAnnadiane
It's in the SDK, the source is available here: opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4.6Tierell
M
20

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>
Monocycle answered 17/7, 2011 at 10:47 Comment(0)
T
12

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.

Tierell answered 6/5, 2011 at 18:15 Comment(2)
Where can i find the original skin, so i can customize it? thanxAnnadiane
It's in the SDK, the source is available here: opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4.6Tierell
M
2

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

Moskowitz answered 26/2, 2011 at 17:46 Comment(1)
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).Onesided
P
2

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%"/>
Pejoration answered 24/10, 2011 at 14:58 Comment(0)
J
0

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

Jackjackadandy answered 7/3, 2011 at 11:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.