The proper place to deal with view layout is in the UIViewController viewWillLayoutSubviews
method. This is called whenever the view controller's view is sized such as when first shown and when rotated.
As you have seen, the view controller's view has not been fully sized yet when viewDidLoad
is called.
If you need to support iOS 4.3 then you can't use viewWillLayoutSubviews
since it was added in 5.0. In this case, do the layout in viewWillAppear:
.