I've been trying to figure this out, but I'm running into some snags. I want to add a UIToolBar to the bottom of my UITableView. When I can get it to show up, the toolbar appears to be attached to the view and scrolls up and down with the table view. I want it to be anchored to the bottom of my view no matter how the TableView scrolls. I'm doing this like so, (please excuse my code writting as I'm at work and don't have xCode or my project available so my keywords are probably going to be wrong. I'm just trying to get the jist of my code across):
Again, this code here is probably not 100% correct, but this is the sequence I used to add the Toolbar.
Becuase this was not what I wanted, I tried creating a new XIB file that had a tableView in the view with a toolBar ontop at the bottom of the view. When I created my UITableViewController I initilized it with the xib, but when I try to load the view in code, it crashes and complains about not finding a tableview. So I went into my XIB and assigned the delegte's view to the tableview. That then worked to load the view, but the toolbar was missing. I assume becuase I was just loading the tableView view and not the contents of the entire view of the controller.
What should be my sequence of events to add a toolbar that is anchored to the bottom of my tableView? I must be missing something here.
Thanks,
Jason
Code:
UITableViewController *myTableViewController = [[UITableViewController alloc] initWithTableStyle:UITableViewStyleGrouped];
UIToolBar *myToolBar = [UIToolBar new];
CGRect *toolBarFrame;
toolBarFrame = CGMakeRect (0, 440, 320, 40);
[toolBarFrame setFrame:toolBarFrame];
[myTableViewController.view addSubView:toolBarFrame];
Again, this code here is probably not 100% correct, but this is the sequence I used to add the Toolbar.
Becuase this was not what I wanted, I tried creating a new XIB file that had a tableView in the view with a toolBar ontop at the bottom of the view. When I created my UITableViewController I initilized it with the xib, but when I try to load the view in code, it crashes and complains about not finding a tableview. So I went into my XIB and assigned the delegte's view to the tableview. That then worked to load the view, but the toolbar was missing. I assume becuase I was just loading the tableView view and not the contents of the entire view of the controller.
What should be my sequence of events to add a toolbar that is anchored to the bottom of my tableView? I must be missing something here.
Thanks,
Jason