I am just starting a new app and the request came to use Interface Builder this time (I normally do all my stuff programmatically) but anyway.
I am trying to have 2 Image Views sit next to each other on both Portrait and Landscape.
I was toying with the storyboard file and I came close but somehow I can't nail it down to work on Landscape.
It seems that my views are always bigger then the actual screen size and on landscape my views overlap each other.
Am I missing something with the auto-layout process?
Thank you in advance.
So here is a visual representation of what I am trying to do:

I have done a very similar task recently, here is my way:
1- Select your view controller in UI Builder
2- Editor->Resolve Auto Layout Issues->Clear All Constraints in View Controller
Now, we don't have any constraints on our View Controller.
3- Select both of the views(You can do it easier on Document Outline View)
4- Editor->Pin->Widths Equally
5- Repeat Step 3
6- Editor->Pin->Heights Equally
Xcode will complain about missing constraints at this point.
7- Repeat Step 1
8- Editor->Resolve Auto Layout Issues->Add Missing Constraints in View Controller
This should now work on all layout directions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With