You can't change layout size at runtime. If you need to change it dynamically, enable unbounded scrolling on your layout, then clamp your scroll values based on your virtual layout size through events. This should give you the exact same effect.