Note that there are some explanatory texts on larger screens.

plurals
  1. POUIView not initialised properly before rotation
    primarykey
    data
    text
    <p>Im using code very similar to below:</p> <pre><code>- (void)flipToViewController:(UIViewController*)targetViewController transition:(UIViewAnimationTransition)transition </code></pre> <p>{ if( targetViewController ) { [[[self activeViewController] view] setUserInteractionEnabled:NO];</p> <pre><code> // force the view to be instantiated (loadView/layoutSubviews) [[targetViewController view] setHidden:NO]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.8f]; [UIView setAnimationTransition:transition forView:self.view cache:YES]; [targetViewController viewWillAppear:YES]; [[self activeViewController] viewWillDisappear:YES]; [[[self activeViewController] view] removeFromSuperview]; [[self view] addSubview:[targetViewController view]]; [[self activeViewController] viewDidDisappear:YES]; [targetViewController viewDidAppear:YES]; [[targetViewController view] setUserInteractionEnabled:YES]; [UIView commitAnimations]; [self setActiveViewController:targetViewController]; } </code></pre> <p>}</p> <p>Im using a flip transition, However, when my targetViewController flips into view, the view isn't initialised properly. The UISegmentedControl looks weird and one subview is in the wrong position. </p> <p>Only after the animation finishes does everything settle into the correct location.</p> <p>I do all my subview setup in viewWillAppear (not viewDidAppear), so i dont understand why it isn't initialised in time.</p> <p>Any suggestions?</p> <p>I also notice (after debugging) that viewWillAppear is called before the viewDidLoad method? Why would it do this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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