I have a Button on a UIViewController. When i click on this Button, a UIToolBar gets displayed (Above the TabBarController). Now when i scroll the view down and click the Button the UIToolBar gets displayed at a different location (way above the tababar). What i want is to display the UIToolBar right above the TabBar at all instances (even when i scroll the page up or down and click the Button).
My code so far :
toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 300 , 320 , 55)];
According to this Code, i have given the X and Y cordinates of the toolBar to be 0 and 323. So even when i scroll the view up or down and click on the button, the toolbar will display at this location.
So how can i modify my code, to display it right above the TabBar at all instances. (Even when i scroll the view up or down)
the problem is: You are adding the toolbar on the view with the coordinate hardcoded to (0, 300 , 320 , 55). And this is with respect to the view. But not the iphone screen or window. after adding when you scroll the view, you can see that the view contents are also scrolled up.
All you have to do is: