views:

80

answers:

1

in controller

scrollView.autoresizesSubviews = YES;

in viewDidLoad of controller I load view object from Nib and

[scrollView addSubview:presentationController.view];

At this point scrollView itself has correct adjusted sizes(which is within tab view controller). The problem is that the layout of newly loaded view object is not updated.

  1. Is there any way to make the object to resize?
  2. Where else I can intercept the point where after adding subview, it's already auto resized, so I can add my code there?

What I need is some additional layout adjustment code for that loaded view, but it should have correct view size to apply the tweaks.

A: 

Try

[scrollView setNeedsLayout];

and see if that helps?

deanWombourne
No, that was first I tried, neither setNeedsDisplay.
Michael
Actually it does eventually resize, but what I need is some point right after it finished resizing, or to force it resize at my desired point (in viewDidAppear).
Michael
When you add the new view, what's it's frame size set to?
deanWombourne
The one I set in nib file, 320x460 - full screen size
Michael
So what changes do you want for the layout if it's already the right size in the xib?
deanWombourne
It is not, the scroll view is located within view, which is in fact tab bar controller's view. so the height supposed to be 411.
Michael
Try setting the frame of your presentationController.view to be the width of the scrollview's frame - this should trigger a relayout. You might also need to set the contentSize of the scrollview to be the size of your added view, otherwise it might not scroll properly?
deanWombourne