-(void)viewWillAppear:(BOOL)animated {
//setup toolbar
[self.navigationController setToolbarHidden:NO];
self.navigationController.toolbar.barStyle = UIBarStyleBlackTranslucent;
self.navigationController.toolbar.alpha = .8;
self.navigationController.toolbar.tintColor = [UIColor colorWithRed:6.0/255.0 green:95.0/255.0 blue:163.0/255.0 alpha:1];
//setup items
UIBarButtonItem *item1 = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self.navigationController.toolbar action:nil];
UIImage *imageUp = [UIImage imageNamed:@"up.png"];
UIBarButtonItem *item2 = [[UIBarButtonItem alloc] initWithImage:imageUp style:UIBarButtonItemStylePlain target:self action:@selector(toggleUp:)];
item2.width = 5;
UIImage *imageDown = [UIImage imageNamed:@"down.png"];
UIBarButtonItem *item3 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:self action:nil];
UIBarButtonItem *item4 = [[UIBarButtonItem alloc] initWithImage:imageDown style:UIBarButtonItemStylePlain target:self action:@selector(toggleDown:)];
UIBarButtonItem *item5 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:self action:nil];
UIBarButtonItem *item6 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(toggleDown:)];
UIBarButtonItem *item7 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
NSArray *itemsArray = [[NSArray alloc] initWithObjects:item1, item2, item3, item4, item5, item6, item7, nil ];
[self setToolbarItems:itemsArray];
...more
}
I am not sure what is happening here and I have read a lot about what to do for the toolbar but I cannot seem to get any of the UIBarButtonItems to display.
Any ideas?