thndrkiss
thndrkiss

Reputation: 4595

splitview controller loaded in portrait and then to landscape

I am dynamically removing a view and adding a splitviewcontroller. I have problems in landscape mode. When I do the same loading in landscape mode the view is first loaded in portrait and then it is turning to landscape mode. Is there a way to solve this problem. There is a temporary flickering and UX is not pleasing.

Upvotes: 0

Views: 451

Answers (1)

Cole
Cole

Reputation: 726

I ran into a similar problem earlier today, I removed the previous views I had added to the UIWindow, then added my other ViewController which resolved the issue, like so;

-(void)loginWasSuccessful {

    // discard the login view controller, and nil it out
    [self.loginViewController_iPad.view removeFromSuperview];
    self.loginViewController_iPad = nil;

    self.splitViewController.view.hidden = NO;
    self.splitViewController.view.alpha = NO_ALPHA;

    // create an animation block that'll fade out the splash view, and fade in the split view controller (that houses employee search)
    [UIView animateWithDuration:LOGIN_TO_EMP_SEARCH_FADE_ANIMATION_DURATION animations:^{   

        // remove and nil the splash and login view from the window...
        self.splashView.alpha = NO_ALPHA;
        self.splitViewController.view.alpha = FULL_ALPHA;

    }];

Hope this helps!

Upvotes: 1

Related Questions