Created
December 30, 2014 18:32
-
-
Save benjaminsnorris/35837610ff4a57c16320 to your computer and use it in GitHub Desktop.
NavController Toolbar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)setUpBottomToolbar { | |
self.navigationController.toolbar.tintColor = [UIColor orangeColor]; | |
self.navigationController.toolbarHidden = NO; | |
self.viewPlayOrHistory = [[UISegmentedControl alloc] initWithItems:@[@"Standard", @"History"]]; | |
self.viewPlayOrHistory.selectedSegmentIndex = 0; | |
UIBarButtonItem *viewSwitchButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.viewPlayOrHistory]; | |
[self.viewPlayOrHistory addTarget:self action:@selector(switchViewToPlayOrHistory) forControlEvents:UIControlEventValueChanged]; | |
UIBarButtonItem *spaceItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil]; | |
[self setToolbarItems:@[spaceItem,viewSwitchButtonItem,spaceItem] animated:YES]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment