11 Replies Latest reply on Dec 16, 2016 8:54 AM by user9259

    Layout Background not resizing when going from Landscape to Portrait

    RobKeys

      Title

      Layout Background not resizing when going from Landscape to Portrait

      Post

           If i set the Layout Background on a theme and then connect to it with Filemaker Go on iPad it does not seem to resize properly when the orientation changes (see images & example file links below). Any insight, fixes, or workarounds?

           Images of issue: http://imgur.com/a/I8QCW

           Example file: https://drive.google.com/file/d/0B4YPyQrXUd6WbVZDMVlNdmZ0Wms/edit?usp=sharing

        • 1. Re: Layout Background not resizing when going from Landscape to Portrait
          TSGal

               Rob Keys:

               Thank you for your post.

               The size of the layout will not change when rotating the device from Landscape to Portrait.  Instead, use the script trigger OnLayoutSizeChange in conjunction with the function Get (WindowOrientation).  The OnLayoutSizeChange will trigger when switching between Portrait and Landscape, and then within the script, use the Get (WindowOrientation) function to determine if the device is in Portrait or Landscape, and then act accordingly.  You may want to keep two instances of the layout and switch between the layouts when rotating the device.

               Let me know if you need additional clarification.

               TSGal
               FileMaker, Inc.

          • 2. Re: Layout Background not resizing when going from Landscape to Portrait
            philmodjunk

                 You can also place an object in the lower right corner of the layout and change the auto-size anchors from "Top and Left" to "Bottom and Right".

                 For simple layouts where I don't need to use the trigger to flip between layouts, I'll size the layout to fit the intersection of the landscape and horizontal orientation stencils with such a "resize object" located as described. I then make the object invisible by entering True into the "Hide Object When" setting for that layout object.

                 I can also set objects to "slide" out from behind other opaque objects that hide them as a way to get a layout to adjust to orientation. And portals and other objects can be set to "Stretch" to a taller height with more rows when the device orients to portrait by setting both top and bottom auto-size anchors.

                 So I don't always set up two layouts for every iOS layout in my system.

            An Old Dog learns some new tricks...

                  

            • 3. Re: Layout Background not resizing when going from Landscape to Portrait
              RobKeys

                   TSGal - The two layout solution is kind of what i figured, but since everything else on the layout with anchors resizes on orientation changes I thought maybe I was missing something as far as the background was concerned. Thanks!

                   PhilModJunk - This all works, and thanks for the advice. I was referring to the 'Layout Background' specifically, which has no anchor controls.

              • 4. Re: Layout Background not resizing when going from Landscape to Portrait
                philmodjunk
                     

                          I was referring to the 'Layout Background' specifically, which has no anchor controls.

                     Which is why you place an invisible layout object on your layout with the anchors that I described. When you rotate the device, those anchors will pull that object down or to the right and force the layout to resize with it.

                • 5. Re: Layout Background not resizing when going from Landscape to Portrait
                  RobKeys

                       Do you have a file anywhere with an example of this working? As you can see from my example file I have an object that resizes just fine when orientation changes and the footer slides down as well, but the Layout Background which is not tied to any layout part stays the same size. I know that i could just fill the various layout parts with images and resize, but then I would not get the one unified image in the background behind all the parts. I think there is no workaround for this other than having two layouts like TSGal said.

                  • 6. Re: Layout Background not resizing when going from Landscape to Portrait
                    philmodjunk
                         

                              but then I would not get the one unified image in the background behind all the parts.

                         What unified image?

                         Have you placed a graphic object in the background or specified a fill color for the layout background? (As opposed to specifying fill colors for the layout parts...)

                    • 7. Re: Layout Background not resizing when going from Landscape to Portrait
                      RobKeys

                           Check my example file or this link if you are confused by my reference to the Layout Background. Again I appreciate your suggestions, they just don't work for this particular issue as I am looking for ways to make the Layout Background specifically resize on orientation change. I think the suggestion of TSGal to create two versions of the layout is my only recourse.

                      • 8. Re: Layout Background not resizing when going from Landscape to Portrait
                        philmodjunk

                             I am aware that the layout background is a separate part of the layout structure and that this is a pretty new aspect of what we can directly access in FileMaker. But much of what we might put into the layout background can be handled by putting it into the layout parts.

                             In your image files, I see a solid color in the background that fails to extend when the window resizes due to the orientation change. But if you specified the same fill color for the Header, body and footer layout parts, this would not be an issue.

                        • 9. Re: Layout Background not resizing when going from Landscape to Portrait
                          RobKeys

                               It's not a solid color in the background, it's an image. I should have picked a better one to illustrate that more clearly. Your solution will not fix this issue. Thank you for your persistence but i will have to create two layouts.

                          • 10. Re: Layout Background not resizing when going from Landscape to Portrait
                            Markus Schneider

                                 That's the way it has to be done with FMGo. If it can't be solved with layout-parts -> create two (or more) separate layouts and use the new trigger.

                                 I'm happy that the layout-parts won't  'slide' - there are FMGo App's that need a fixed layout 'frame', especially when creating 'Kiosk'-App's that must NOT resize (-:

                                  

                            • 11. Re: Layout Background not resizing when going from Landscape to Portrait
                              user9259

                              I have yet to find a good example of using OnLayoutSizeChange for web-direct solutions. And FM excluded any Web Direct solutions in the FM 15 Training series. If anyone knows of a good example of using this method to deliver proportionately sized layouts in webdirect. PLEASE HELP...