7 Replies Latest reply on Sep 21, 2007 11:52 AM by Peter Flynn (Adobe)

    Problem with constraint based layouots

    ab1301 Level 1
      When I anchor an item to the centerline of the page, if the browser window is too small to see the whole item, the item is cut-off on both sides, and a scroll bar pops up. OK, fine so far...

      But the scroll bar only scrolls towards the right, so that the left side of the item is permanently off-screen and there is no way to scroll over and see it.

      Is there a way to do this so that the scroll bar scrolls to the left? Or is there another way I should be centering things? I am trying to make an app that will work well and look good on all shapes and sizes of monitors, and it is VERY frustrating.
        • 1. Re: Problem with constraint based layouots
          joan_lafferty Adobe Employee
          When you say that you are anchoring to the centerline of the page, do you mean that you are using the horizontalCenter style of the component and setting it to 0. What are the other attributes of this component that you are centering (e.g. width attributes?). Please post some sample code to help us understand your problem.

          Thanks,
          Joan Lafferty
          Flex SDK QA
          • 2. Re: Problem with constraint based layouots
            ab1301 Level 1
            There is not just one component, there are many, and their attributes vary. I am using the horizontalCenter style. For some components it is set at 0, some at positive numbers, and some at negative numbers. I am trying to get all of the elements aligned properly relative to eachother and the center of the page. Attached is a sample of the problem. When viewed in a large enough browser screen, it's fine, but when the browser screen is reduced, items on the left get cut off, and you cannot scroll left to view them.
            • 3. Re: Problem with constraint based layouots
              Peter Flynn (Adobe) Adobe Employee
              Hi ab1301,

              I filed a bug for you at:
              https://bugs.adobe.com/jira/browse/SDK-12682

              Although it won't get you around this bug, I wanted to point out that you can simplify your MXML quite a bit by nesting the objects in a centered container:

              • 5. Re: Problem with constraint based layouots
                ab1301 Level 1
                I just saw that fixing this bug has been deferred. I would think since display consistency accross platforms is one of flash/flex's selling points this would be high priority. Many people out there still set their monitors to 800x600 (obviously nobody at Adobe...), even when the monitor is capable of higher resolution. It would be a shame to have to choose between not getting the design you want or having part of your application completely unviewable by anyone with a 800x600 display.

                At least there should be a work around... I've tried using spacers and containers in different configurations, but still can't get it to work. Any ideas?

                As a possible alternative, is there a way to make a container's size relative to the size of the browser window, but still have a minimum width?
                • 6. Re: Problem with constraint based layouots
                  ab1301 Level 1
                  After taking a fresh look at the problem again tonight, I finally found a work around/solution that does what I want: Give the application a vertical layout, then place everything in a container with an absolute layout.
                  • 7. Re: Problem with constraint based layouots
                    Peter Flynn (Adobe) Adobe Employee
                    Thanks for posting your workaround! We will allow voting on deferred bugs very soon, so you and others in the community will have the power to raise the priority of this issue.

                    - Peter