splitview 控制器以纵向加载,然后横向加载

发布于 2024-10-05 18:18:06 字数 118 浏览 0 评论 0原文

我正在动态删除视图并添加 splitviewcontroller。我在横向模式下遇到问题。当我在横向模式下执行相同的加载时,视图首先以纵向加载,然后转向横向模式。有没有办法解决这个问题。存在暂时的闪烁,用户体验不令人满意。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

維他命╮ 2024-10-12 18:18:06

今天早些时候我遇到了类似的问题,我删除了之前添加到 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;

    }];

希望这有帮助!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文