Can't see elements from storyboard inside viewcontrollers

1.8k views Asked by At

some elements from my storyboard don't appear since I change the viewcontroller size to 4.7inch. But if I create another viewcontroller and I put some object inside, they are appearing. What's wrong with these viewcontrollers?

enter image description here

2

There are 2 answers

1
Pavithra Duraisamy On BEST ANSWER

This is because the UI elements or constraints you have added to the view controller with specific size class will become inactive while to change to some other size class. for example the UI elements or constraints added to view controller with compact width | Any height will become inactive while you change to Any width | Any height.

You can enable it by checking the option in your attribute inspector[scroll down to the bottom]. Please refer to the screen shot.

enter image description here

0
Bhavin Bhadani On

If you want to display all your objects in different size classes, you should use auto layout....it manage your object to display in different size classes...

So, The solution to prevent your object to hidden from different size classes, use autolayout

Here is the image...that explains better than words

enter image description here

In this image I gave autolayout to button using wAnyhAny...for best practice..