Note that there are some explanatory texts on larger screens.

plurals
  1. POUIViewController resizing itself between viewWillAppear and viewDidAppear?
    text
    copied!<p>I've got a really strange bug in my project. I've got a <code>UIScrollView</code> as my main, big view. Inside of it, I have a <code>UIViewController</code> (not <code>UITableViewController</code>) which has a <code>UITableView</code> instance variable, as well as some miscellaneous <code>UIButtons</code>. I have set the view controller's view frame to <code>CGRectMake(0, 64, 320, 388)</code>, as I have a tab bar above it (this is not functional yet). At first it works great and looks great, but once I present and dismiss a <code>modalViewController</code> (thus reloading the <code>UIViewController</code>, I believe), it pushes the <code>UIViewController</code>'s view to the top of the screen (by default setting it to <code>CGRectMake(0, 0, 320, 460)</code>, but since I've set <code>wantsFullScreenLayout</code> to <code>NO</code>, it now sets it to <code>CGRectMake(0, 0, 320, 388)</code>.</p> <p>I've tracked this problem to somewhere between <code>viewWillAppear</code> and <code>viewDidAppear</code>. Here are my exact logs after dismissing the <code>modalViewController</code>:</p> <blockquote> <p>2011-05-06 11:08:39.974 Campus[1570:207] Frame is 0.000000, 64.000000, 320.000000, 388.000000 (viewWillAppear)<br> 2011-05-06 11:08:40.378 Campus[1570:207] Frame is 0.000000, 0.000000, 320.000000, 388.000000 (viewDidAppear)</p> </blockquote> <p>As you can see, the frame is fine in <code>viewWillAppear</code>, but not in <code>viewDidAppear</code>.</p> <p>I've done the following things to try to fix it:<br> - Set the desired frame in <code>loadView</code>, <code>viewDidLoad</code>, <code>viewWillAppear</code>, and <code>viewDidAppear</code>.<br> - Set my <code>wantsFullScreenLayout</code> to <code>NO</code>.<br> - Killed my <code>[super viewWillAppear:]</code> and <code>[super viewDidAppear:]</code> calls in my method overrides.</p> <p>What should I do?!?!?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload