返回 MainView 后隐藏所有对象

发布于 2024-11-30 11:38:32 字数 333 浏览 2 评论 0原文

在实用程序应用程序中,在 viewDidLoad 方法中,我具有以下功能,其中包括:

[self hideObjects];
[self setColorAndSizes];
[self fadeInEverything];

这三个方法组合起来,首先隐藏屏幕上的所有对象,然后适当调整大小和颜色,然后将每个对象淡入视图中,一次一个。现在,当用户转到 FlipsideView,然后返回到 MainView 时,尽管我在 viewDidAppear 中具有相同的三个函数,但所有对象可能会出现半秒,然后消失并淡入。为什么不隐藏立即,就像他们在 viewDidLoad 方法中所做的那样?

in a utility application, in the viewDidLoad method, I have the following functions, among others:

[self hideObjects];
[self setColorAndSizes];
[self fadeInEverything];

These three methods, combined, first hide all objects on the screen, then adjust the sizes and colors appropriately, and then fade each of them into view, one at a time. Now, when the user goes to the FlipsideView, then returns to the MainView, although I have the same three functions in viewDidAppear, all of the objects appear for maybe half a second, then disappear, and fade in. Why don't the hide immediately, like they do in the viewDidLoad method?

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

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

发布评论

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

评论(1

生活了然无味 2024-12-07 11:38:32

viewDidLoad 在视图加载时被调用。然而,在具有翻转功能的实用程序应用程序中,当应用程序翻转以显示背面时,MainView 实际上永远不会消失。当您按下后退按钮时,您所做的就是关闭 FlipsideView。 MainView 再次出现,但未加载。您在 MainView.m 中看到这段代码了吗?这就是为什么:

- (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller {

        [self dismissModalViewControllerAnimated:YES];
}

viewDidLoad is called when the view loads. However, in a utility application that has the flip, when the app flips to reveal the backside, MainView really never goes away. All you're doing when you hit the back button is DISMISSING the FlipsideView. MainView appears again, but isn't loaded. Do you see this code in MainView.m? This is why:

- (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller {

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