11 Replies Latest reply on Sep 9, 2008 11:01 AM by EvolvedDSM

    remove application scrollbars

    perflexed Level 1
      Hi,
      When I view my application in the browser, the application has both horizontal and vertical scrollbars.
      How can I get rid of those? i.e. if the user's browser window is too small for the app then I'm happy for the browser to do the scrolling.

      thanks
        • 1. Re: remove application scrollbars
          Ansury Level 3
          In the API docs look up:

          horizontalScrollPolicy and verticalScrollPolicy (set to "off" in your mxml)
          • 2. Re: remove application scrollbars
            EvolvedDSM Level 2
            Typically when a Flex app adds scroll bars, it's because there is still a component(s) that isn't being displayed in the app without the use of scroll bars.

            Can you be more specific as to what is having scroll bars included on it? Is it your whole application? Or just a frame?

            One thing to note is to check the width and height of your main application. If height and width is anything but a blank value or 100%, then this could certainly prompt your app to bring up scroll bars, especially if your dimensions are greater than your monitor's resolution.

            ie, you made an app 1600x1280 but your PC's resolution is only 1024x768.

            Give me some specifics though. What would be great is if you could just post a link to your app (it doesn't have to have any funcionality to it, just the front end Flex components) and then we can see where it's creating the scroll bars. By default, Flex will not create scroll bars for you unless there is excess components off-screen.
            • 3. Re: remove application scrollbars
              JimBrychka
              I have played around with this and it all depends on how you set up the length and width of your containers. I have had good success with setting my main container to width of 978 and not specifying the length. This keeps the width visible in a 1024 X 768 resolution. I then set my ViewStack resizeToContent property to true. The width of the children containers of the main container are then usually set to 100%.
              • 4. Re: remove application scrollbars
                Ansury Level 3
                I think he's talking about when the browser window is resized smaller than the minimum dimensions his app's UI will comfortably support. I'm guessing he wants to keep a specific width/height for the app overall.
                • 5. Re: remove application scrollbars
                  Level 7

                  "perflexed" <webforumsuser@macromedia.com> wrote in message
                  news:ga630f$94j$1@forums.macromedia.com...
                  > Hi,
                  > When I view my application in the browser, the application has both
                  > horizontal and vertical scrollbars.
                  > How can I get rid of those? i.e. if the user's browser window is too small
                  > for
                  > the app then I'm happy for the browser to do the scrolling.

                  In the html-template/index.template.html file change line ~77 to read <body
                  scroll="auto"> instead of the default which turns it off explicitly.


                  • 6. Re: remove application scrollbars
                    EvolvedDSM Level 2
                    Amy doesn't that depend on if it's his browser that is adding the scroll bars or if it's the Flex app itself? They both have the ability to add scroll bars.

                    We don't really know the situation yet. I'm still waiting to SEE this example. My guess is the same as JB2622. Most likely a conflict in container sizes.
                    • 7. Re: remove application scrollbars
                      perflexed Level 1
                      Hi,
                      The scrollbars are being added by the player rather than the browser. So I can have my browser at 1900x1200 , with the width of the application container set at 1014 and I still get scrollbars.

                      Unfortunately the app isn't online anywhere for visual inspection.

                      I have about 6 components making up the layout and all of them have their width explicitly set to 1024, which is what has me puzzled.

                      I will try a few of the things suggested here and see if they help.

                      thanks
                      • 8. Re: remove application scrollbars
                        Level 7

                        "EvolvedDSM" <webforumsuser@macromedia.com> wrote in message
                        news:ga6b5v$j1i$1@forums.macromedia.com...
                        > Amy doesn't that depend on if it's his browser that is adding the scroll
                        > bars
                        > or if it's the Flex app itself? They both have the ability to add scroll
                        > bars.
                        >
                        > We don't really know the situation yet. I'm still waiting to SEE this
                        > example. My guess is the same as JB2622. Most likely a conflict in
                        > container
                        > sizes.

                        He says he wants the browser to draw the scroll bars, not Flex.

                        Hope this clarifies;

                        Amy


                        • 9. remove application scrollbars
                          Ansury Level 3
                          When you have a bunch of nested containers it's easy to run into issues like this sometimes. The scrollbars may not be at the application level, it could be another container like a canvas. Try setting horizontalScrollPolicy and verticalScrollPolicy to "off" within various containers one at a time (starting at the Application level tag), eventually the scrollbars will vanish and you'll know which container is the offender. Maybe something is just one pixel too big...
                          • 10. Re: remove application scrollbars
                            Level 7

                            "Ansury" <webforumsuser@macromedia.com> wrote in message
                            news:ga6ccb$kdi$1@forums.macromedia.com...
                            > When you have a bunch of nested containers it's easy to run into issues
                            > like
                            > this sometimes. The scrollbars may not be at the application level, it
                            > could
                            > be another container like a canvas. Try setting horizontalScrollPolicy
                            > and
                            > verticalScrollPolicy to "off" within various containers one at a time,
                            > eventually the scrollbars will vanish and you'll know which container is
                            > the
                            > offender.

                            It also helps to set minHeight and minWidth, but I forget whether it is
                            better to set them to 0 or to the height and width property.

                            HTH;

                            Amy


                            • 11. remove application scrollbars
                              EvolvedDSM Level 2
                              Perflexed can you take a screen shot and host it with imageshack or something?

                              Also, I recommend using percentages for containers inside your main app. Simply set the dimension of your main app and then let the containers reside within using percentage width and height. Flex will never let your containers grow larger than your app so long as percentages are being used (I believe).