I have a UIViewController subclass whose view is configured in a NIB file. The view has a UIScrollView subview.
The UIScrollView takes up almost its entire NIB file but it’s superview is added as a subview to a much smaller view (configured in a different NIB) – e.g. the UIScrollView is 80% the height of it’s own NIB but ends up only being 10% the height of the application’s window.
When I call [scrollView bounds].size.height in the viewController’s viewDidLoad method, I get the height of the scrollView relative to it’s own NIB, rather than the height it ends up resizing to as dictated by its superviews (e.g. 80% of the window’s height rather than 10%).
If I call [scrollView bounds].size.height later on (e.g. to handle a rotation event), I get the correct value.
How can I get the correctly re-sized value initially?
Have you tried dealing with it in
viewWillAppear:orviewDidAppear?