Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do my views in storyboard vary in height / not show the navigation bar?

I have quite a large storyboard with many views, a lot of them do not display at the correct size or even have a navigation bar. Is this some kind of bug in XCode?, because they all look fine when simulated or built to a device.

Thanks

like image 570
Halpo Avatar asked Dec 14 '25 17:12

Halpo


1 Answers

I have faced it lot of time below solution works every time.

Try This One:
1. Select the StoryBoard you are facing problem
2. Goto Attributes Inspector -> Simulated Metrics -> Size -> There are four options(default is inferred)
3.Select or switch between options other then default(repeat it twice or more if needed) then resize your views and controls to fit your selected screen size.

According to me this happens because:
Sometimes inferred (size) behaves as if its an 3.5 retina screen but our storyboard size is retina 4 full screen or vice-versa

Best Practice to avoid such problems :
When you start working with storyboard first select appropriate size you want to work with (3.5 or 4 full screen) then only you should set your views or controls.

like image 52
bhavya kothari Avatar answered Dec 17 '25 11:12

bhavya kothari



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!