gpt4 book ai didi

ios - 关闭当前 View Controller 时 UIView 框架发生变化

转载 作者:行者123 更新时间:2023-12-01 16:53:26 25 4
gpt4 key购买 nike

我有一个模态的 View 。此 View 呈现另一种模态视图。当 View 被关闭时,初始 View (第一个模态视图)会改变它的框架。所以我在这个 View 上的工具栏会在状态栏下向上滑动...
如何解决?

2012-12-11 14:53:49.976 app[11225:907] toolbar frame: {{0, 0}, {320, 44}}
2012-12-11 14:53:49.979 app[11225:907] view frame: {{0, 20}, {320, 460}}
2012-12-11 14:54:07.496 app[11225:907] toolbar frame: {{0, 0}, {320, 44}}// here the second modal view is dismissed
2012-12-11 14:54:07.498 app[11225:907] view frame: {{0, 0}, {320, 480}}

该应用程序不使用全屏...

最佳答案

应该这样做是因为 presentModalViewController 已弃用和 dismissModalViewControllerAnimated .这两种方法在 iOS6 中已弃用。

试试这个代码。这会帮助你

// ~~~~~~~~~~~~~~present

if ([self respondsToSelector:@selector(presentViewController:animated:completion:)])
{
[self presentViewController:test animated:YES completion:nil];
}
else
{
[self presentModalViewController:test animated:YES];
}
// ~~~~~~~~~~~~~~dismiss

if ([self respondsToSelector:@selector(dismissViewControllerAnimated:completion:)])
{
[self dismissViewControllerAnimated:animated completion:nil];
}
else
{
[self dismissModalViewControllerAnimated:animated];
}

希望对你有帮助............

关于ios - 关闭当前 View Controller 时 UIView 框架发生变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13820967/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com