Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it important to design iPhone App layouts flexible?

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?

like image 725
Thanks Avatar asked Dec 06 '22 06:12

Thanks


2 Answers

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!

like image 188
Jonathan Arbogast Avatar answered Jan 12 '23 02:01

Jonathan Arbogast


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:

  • Users might select bigger fonts
  • The next generation of the device gets a bigger screen
  • Translators hate it when they have to fit words into pixel-tight spaces
  • An add-on might take up a few pixels on the screen
  • A change in the OS might change the screen size by a few pixels
  • When I'm using predefined icons, their size might change
  • Ultimately, in a flexible application, the user can choose what she wants to see. I don't want her to have to layout the UI.

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.

like image 24
Aaron Digulla Avatar answered Jan 12 '23 02:01

Aaron Digulla