我正在动态删除视图并添加splitviewcontroller。我在横向模式下遇到问题。当我在横向模式下进行相同的加载时,视图首先以纵向方式加载,然后转向横向模式。有没有办法解决这个问题。有一个暂时的闪烁,用户体验不愉快。
答案 0 :(得分: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;
}];
希望这有帮助!