Information Technology Reference
In-Depth Information
TIP
It's not always easy to remember the dimensions of the various possible navigation and status features. For-
tunately, you don't have to, because IB snaps a background view to the correct size when you create a new pro-
ject from a template. If you add and resize further custom sub-views, IB's snap feature helps you resize them cor-
rectly. Note that you can extend a custom sub-view outside the screen area or hide parts of it under navigation
objects. This isn't usually a useful thing to do, but the option is there if you need it.
TIP
View management for iPad UIs includes similar features. OS X UIs include related view snapping features, but the
design is more open-ended. You don't typically need to shrink a view by a fixed size, unless your application al-
ways runs full screen and you need to compensate for the menu bar, in which case you should read the screen di-
mensions dynamically without assuming a set size. In theory, iOS apps should also make no assumptions about
screen dimensions, but this makes UI design very difficult. It's easier to assume the standard screen sizes are val-
id—for now.
Adding code to the subclass
The drawRect: method in a UIView is called whenever the screen is refreshed. A refresh happens automat-
ically on launch, so adding code to drawRect: is a good way to create a custom background.
Search WWH ::




Custom Search