2

I have a view that is modal presented. This view presents another modal view. When the view is dismissed the initial view (the first modal view) changes it's frame.. So a toolbar I have on this view slides up under the status bar... how can this be fixed?

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

The app does not use full-screen ...

user1028028
  • 6,323
  • 9
  • 34
  • 59
  • I flagged this question as duplicate. You asked the question yesterday here : http://stackoverflow.com/questions/13788847/uitoolbar-slides-under-status-bar Please don't post multiple questions on the same issue. Edit your first question and put the information you provide here in the other question. – rdurand Dec 11 '12 at 13:04

1 Answers1

0

this should be done because of deprecation of presentModalViewController AND dismissModalViewControllerAnimated. these two methods are deprecated in iOS6.

Try this code. this will help you

// ~~~~~~~~~~~~~~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];
}

Hope this will help you............

Nirav Gadhiya
  • 6,342
  • 2
  • 37
  • 76