Hello to all,
I have an app with a navigation bar at the top. On one view that is a subclass of UITableView, I add a UIToolbar beneath the UITableView with the following code:
UIToolbar *toolbar = [[UIToolbar alloc] init];
[toolbar sizeToFit]; // Set the toolbar to fit the width of the app
CGFloat toolbarHeight = [toolbar frame].size.height; // Calculate the height of the toolbar
CGRect rootViewBounds = self.parentViewController.view.bounds;
CGFloat rootViewHeight = CGRectGetHeight(rootViewBounds);
CGFloat rootViewWidth = CGRectGetWidth(rootViewBounds);
CGRect rectArea = CGRectMake(0, toolbarHeight, rootViewWidth, toolbarHeight);
[toolbar setFrame:rectArea];
[self.navigationController.view addSubview:toolbar];
The problem is that the toolbar is "on top" of the UITableView and is masking over the top of the contents of the first row in the UITableView. What I really want is for the table view to "start" beneath the UIToolbar.
How do I make this work appropriately?
Gracias, Jose