Search code examples
iphonesubviewautoresize

Making view to autoresize


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.


Solution

  • Try

    [scrollView setNeedsLayout];
    

    and see if that helps?