In Apple's UICatalog example, there is a snippet that they wrote to position a toolbar at the bottom of the screen in a navigation controller view (in the ToolbarViewController.m).
What I don't understand is why are they shifting the toolbar downwards by 2px (the +2.0 part)? This effectively makes the toolbar look 2px shorter than a normal toolbar. Is this intentional or is there something I am missing here?
Thanks guys!
Code:
// size up the toolbar and set its frame
[toolbar sizeToFit];
CGFloat toolbarHeight = [toolbar frame].size.height;
CGRect mainViewBounds = self.view.bounds;
[toolbar setFrame:CGRectMake(CGRectGetMinX(mainViewBounds),
CGRectGetMinY(mainViewBounds) + CGRectGetHeight(mainViewBounds) - (toolbarHeight * 2.0) + 2.0,
CGRectGetWidth(mainViewBounds),
toolbarHeight)];
[self.view addSubview:toolbar];
What I don't understand is why are they shifting the toolbar downwards by 2px (the +2.0 part)? This effectively makes the toolbar look 2px shorter than a normal toolbar. Is this intentional or is there something I am missing here?
Thanks guys!