Switch between 'Expand to Fill' and 'Shrink to Fit' with code


(Lachnowicz) #1

Hi,

For a responsive project i wonder if i can change some element properties with javascript within a same layout.
Why ? i want to use a portrait & paysage 2 layouts system (it works already), which then adapts the scaling behavior of some elements depending of the window width.

For example switch a group in the timeline between ‘Expand to Fill’ and ‘Shrink to Fit’ with code ?
Is it possible ?


(Hans-Gerd Claßen) #2

… no method to change this on runtime.

possibilities:

. different layouts using different reponsive settings on elements

. don’t use reponsive settings but hypes setter-API to scale elements


(Lachnowicz) #3

Thank you ! I’m curious, I will investigate this hypes setter-API.
Meanwhile i found a workaround for my project.

  • Made 2 symbols with all the screen elements (one for portrait, one landscape) for portrait & landscape layouts.
  • Added 2 more layouts : ‘portrait_large’ and ‘landscape_large’
  • Changed the symbols ‘expand’ and ‘shrink’ stuff in each layout.
  • With the symbols, its almost like having 2 layouts to manage only.