1

I have an UIView that is set to autoresize depending the partent view, The problem is that the frame returns the original size even when it is autoresized.

- (void)awakeFromNib{
       NSLog(@"%@", NSStringFromCGRect(self.frame));}

it is returns the original size!

1 Answers1

1

You must use one of the viewController lifecycle function to get the real size of the subviews.

One of them will work:

  • viewDidLayoutSubviews
  • viewDidAppear

For more details check the answer of this question: Unable to set frame correctly before viewDidAppear

Community
  • 1
  • 1
Balazs Nemeth
  • 2,333
  • 19
  • 29