Button is pressed from the Mainviewcontroller which presents view and from this view when infobutton is pressed to present Modalviewcontroller and when ModalViewController is dismissed to go back to view. And once view is loaded UIToolbar shows gap from the bottom and gap is of UIToolbar height.

What is the class of your MainViewController? Is it UINavigationController, or UIViewController or UITabBarController? You said "once view is loaded UIToolbar shows gap " is it right after launch or after dismissing the modal? Where is UIToolbar in your modally shown view or in MainView?
–
CanopusFeb 8 '12 at 17:49

Mainviewcontroller is UIViewController. UIToolbar isin the mainviewcontroller. when app is launched everything is good when app mainviewcontroller displays view via pressed button and on this view when u see uitoolbar again and presses infobutton and it displays modalviewcontroller and when this modalviewcontroller is dismissed and view is loaded back that is where uitoolbar shows gap from the bottom.
–
user1120133Feb 8 '12 at 17:59

You may need to post some part of your code to see what exactly is going on. Seems when you dismiss the view, the coordination of toolBar changes, but it is hard to say anything this way.
–
CanopusFeb 8 '12 at 18:04

i just added code of the view displayed when button ispressed from the mainviewcontroller
–
user1120133Feb 8 '12 at 18:09

Do you call this method "-(void)displayviewsAction:(id)sender" again, when you dismiss the modalView?
–
CanopusFeb 8 '12 at 18:13

i was having the same issue when view gets loaded very first time when button is pressed i.e uitoolbar shows gap and plus modalviewcontroller shows gap as well between the statusbar and modalviewcontroller when loaded from the view. So that is why i used this line and this line solved the gap when view is loaded first when button is pressed and it also solved the gap of modalviewcontroller. Now only gap issue i m having when modalviewcontroller is dismissed.
–
user1120133Feb 8 '12 at 20:27

Have you checked the sized of the views in the XIB files? They should be 320x480 if there is no status bar and 320x460 if there is one.
–
Nikola KirevFeb 8 '12 at 22:10

previously i was using this two lines self.view setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone]; now removed both of them and only using self.view.superview.frame = CGRectMake(0, 0, 320, 480); it fixes uitoolbar gap when loads view as wellas when modalviewcontroller is dismissed but now when view is loaded first it shows gap between the status bar and modalviewcontroller and same is when modalviewcontroller is dismissed.
–
user1120133Feb 8 '12 at 22:32