Graphics Programs Reference
In-Depth Information
From the
Scheme
menu next to the Run button, choose either the iPad simulator or an
iPad device if you've got one plugged in (
Figure 8.10
)
. Then build and run. Notice that
the interface automatically resizes itself appropriately for the larger window.
Figure 8.10 Changing simulator
Setting autoresizing masks programmatically and bitwise operations
The autoresizing mask can also be set programmatically by sending the message
setAutoresizingMask:
to a view.
[view setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin |
UIViewAutoresizingFlexibleHeight];
This says that the view will resize its height when its superview's height changes; this is
the same as checking the vertical spring in a XIB file. It also says that the left margin is
flexible - which is the same as
un-
checking the left strut. In a XIB file, this autoresizing
mask would match the one shown in
Figure 8.11
.
Figure 8.11 Autoresizing mask with flexible left margin and flexible height