2010-12-03 62 views
0

我動態地刪除視圖並添加一個splitviewcontroller。我在橫向模式下遇到問題。當我在橫向模式下進行相同的加載時,視圖首先以縱向加載,然後轉向橫向模式。有沒有辦法解決這個問題。有一個臨時閃爍,用戶體驗不愉快。splitview控制器在縱向加載然後到橫向

+0

通過你的措辭,這聽起來像你沒有使用分割視圖控制器作爲根視圖控制器。那是對的嗎?如果是這樣,那可能是你問題的一部分。 – 2010-12-03 03:46:03

回答

1

今天早些時候我遇到了類似的問題,我刪除了以前添加到UIWindow的視圖,然後添加了我的其他ViewController來解決問題,就像這樣;

-(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; 

    }]; 

希望這有助於!

相關問題