2

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

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}}

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

4

1 回答 1

0

presentModalViewController由于弃用了AND , 因此应该这样做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];
}

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

于 2013-03-21T09:15:42.573 回答