开发者

minWidth setting ignored in flex 3.5?

I've done a bit of a search but couldn't find an answer to this question.

For example:

sampleComponent.explicitMinWidth = 500;
sampleComponent.explicitWidth =开发者_StackOverflow 10;

Sets the width of the sampleComponent to 10, even though I've set the minimum width to 500.

The same thing seems to happen with width. In Adobe's documentation, it states that 'measuredMinWidth - Specifies the default minimum height and minimum width of the component, in pixels. Flex cannot set the size of a component smaller than its specified minimum size.'

I've tried setting the measuredMinWidth as well, same result.

Eventually, I tried every combination of minimum width settings I could, but they were all ignored when I set the width (or explicit width).

sampleComponent.measuredMinWidth = 300;
sampleComponent.minWidth = 300;
sampleComponent.explicitMinWidth = 300;
sampleComponent.width = 10;

Additionally, what is the difference between width and explicitWidth, in every case I've tried, they have performed identically (couldn't find any help on this either)


The min/max values are considered only when flex is calculating the size of the component. If you explicitly set values to width/height yourself those values will be ignored.

Which brings us to the issue of explicit: size of a component may be set by either specifying a fixed value, or a percentage. When setting a fixed value (in mxml) for width/height, that value gets saved in explicitWidth, explicitHeight etc, while percentages get stored in percentageWidth, percentageHeight and so on...

More info about this can be read on the adobe livedocs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜