Search code examples
iosobjective-cuistoryboarduiinterfaceorientationios-autolayout

how to change the position of view on orientation change with just storyboard


I have a view B which comes below view A on Potrait but when the device changes its orientation to landscape then I want the view B to be horizontally paralell to view A

I am able to do this by adding removing constraints programatically but it seems to be a overkill.

Any solutions on how to do it storyboard itself.


Solution

  • You can use "Trait Variation" in interface builder to specify what the layout should look like when portrait or landscape. https://www.techotopia.com/index.php/Using_Trait_Variations_to_Design_Adaptive_iOS_User_Interfaces