Flex 2 and horizontal scrollbars

I was mucking about with viewing the flex unit converter at different screen sizes and noticed that when viewed at a size small enough to require a vertical scroll bar, a horizontal scroll bar would also appear. Basically the introduction of the vertical scrollbar adds 16 pixels to the entire movie, without first removing 16 pixels from the root components current width. I guess you can get around this by giving your root component a padding of 16, or adding the "horizontalScrollPolicy='off'" property to the application tag.

Is anyone aware of any other ways to remedy this behaviour?

Be Sociable, Share!
Posted in Flex

13 comments on “Flex 2 and horizontal scrollbars
  1. tuna says:

    look how i care

  2. Jason says:

    Did you want a frog or not!

    hehe, hi Tone – just sent an email to Richie. Hope you guys are going well over there.

  3. Brandon says:

    was surfing around for a unit converter, not for the example code but to well convert stuff and came across this page. Ironic that I happen to be just diving into flex myself. Anyway, just wanted to drop a line and say great app!

    brandon

  4. I am having this same problem, its quite annoying that the flex components aren’t aware that the scrollbars take up some of the width or height and resize themselves automatically. I haven’t come up with a good work around yet.

  5. Roaders says:

    How about this:

    optionsScrollCanvas.height) ? optionsScrollCanvas.width-16 : optionsScrollCanvas.width}” />

  6. Roaders says:

    although obviously that garbled it! try this:

    <mx:Canvas width=”100%” height=”100%” id=”optionsScrollCanvas”>
    <mx:VBox id=”bxPropertyList”
    width=”{(bxPropertyList.height > optionsScrollCanvas.height) ? optionsScrollCanvas.width-16 : optionsScrollCanvas.width}” />
    </mx:Canvas>

  7. Hob says:

    Just override the measuredHeight property in script:

    override public function get measuredHeight():Number{
    return (this.horizontalScrollBar)? (super.measuredHeight this.horizontalScrollBar.height):super.measuredHeight
    }

  8. DenisPat says:

    I’v just had the same problem and fixed it with the VBox minWidth=’0′ minHeight=’0′.
    See: http://bugs.adobe.com/jira/browse/SDK-15567

  9. zookeeper says:

    This seemed to work better for me at the root node, application level.

    import mx.core.Application;
    override public function get measuredWidth():Number{
    var out:Number = Application.application.width;
    if (Application.application.verticalScrollBar){
    out -= Application.application.verticalScrollBar.width;
    }
    return out;
    }

  10. mq says:

    I love you DenisPat, that worked perfectly.

  11. noambi says:

    Thanks DenisPat!

  12. Usman Farooq says:

    VBox minWidth=’0′ minHeight=’0′. This simple hack works perfectly

  13. DenisPat says:

    Much obliged :)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Posts this month
August 2006
M T W T F S S
« Jul   Sep »
 123456
78910111213
14151617181920
21222324252627
28293031  
Archives