草庐IT

iphone - dismissModalViewControllerAnimated 将原始 View 中的 View 向上移动 20 像素

coder 2024-01-22 原文

我在标签栏的其中一个标签中有一个导航 Controller 。

在导航 Controller 中我有 Root View 。

我正在呈现这样的模态视图:

[self presentModalViewController:modalViewController animated:YES];

但是,当我关闭 View 时:

 [self dismissModalViewControllerAnimated:YES];

.. 原始 View 向上移动了 20 像素,因此它位于状态栏下方。有办法避免这种情况吗?

最佳答案

如果您正在使用标签栏,您应该从 UITabBarController 中呈现您的 View ,以便您的标签内容保持不变:

[self.tabBarController presentModalViewController:modalViewController animated:YES];

[self.tabBarController dismissModalViewControllerAnimated:YES];

关于iphone - dismissModalViewControllerAnimated 将原始 View 中的 View 向上移动 20 像素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7889763/

有关iphone - dismissModalViewControllerAnimated 将原始 View 中的 View 向上移动 20 像素的更多相关文章

随机推荐