停止视图上的用户交互

发布于 2024-11-29 05:26:37 字数 460 浏览 0 评论 0原文

我的代码做了一个从右向左翻转的动画。问题是在切换时,只有 0.75 秒的动画,用户仍然能够与程序交互。我不希望他们能够这样做,有没有一种方法可以短时间停止所有用户交互,或者只是一种完全停止它的方法,然后我可以使用计时器将其重新打开。这是我的动画代码:

        [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.75];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight
                           forView:[self view]
                             cache:YES];
    [UIView commitAnimations];    

谢谢,雅各布

My code does an animation that flips from right to left. The problem is while its switching, only a .75 second animation, the user is still able to interact with the program. I dont want them to be able to, is there a way to stop all user interaction for a short time, or just a way to stop it completely, then i can just use a timer to put it back on. here is my code for the animation:

        [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.75];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight
                           forView:[self view]
                             cache:YES];
    [UIView commitAnimations];    

Thanks, Jacob

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

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

发布评论

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

评论(1

一身骄傲 2024-12-06 05:26:37

尝试:

[self.view setUserInteractionEnabled:NO];

Try:

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