I am wondering if I would run into troubles when setting the heights of my views in the neb with fixed values.
Example: The height of the Status Bar is known. It's 20 units. So when making a view that shows an nice interface, what would happen when the user takes a phone call while using the App, and the Status Bar increases in height? Or what if Apple changes the height of the Status Bar, or Tab Bar, some day in future?
Do you always use autoresizing features for your container-view that has all the interface elements inside? What's your pattern?
I would steer clear of hard coding values for the heights of the status bar, tool bar, etc into your program. You present some good examples of how these values are dynamic and can change in the future. One other common scenario that you may or may not be supporting is the ability of the user to rotate the iPhone into landscape orientation.
I always try to keep the layout of the subviews of a container flexible. Using the autoresizing feature is a good approach. Your question is a good one and I think its going to make me review my own layout strategy!
I always use a flexible layout that resizes automatically because that allows me to focus on the design and let the computer figure out the math.
[EDIT] My reason is that something is going to change and I don't want to do the math again in this case. Things that can change:
So if you make your layout static, you'll eventually have to do it again. And again. Until you learn that the only constant in software development is change.
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