Guest User

Untitled

a guest
Jul 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. UISegmentedControl *topSegmentControl = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"One", @"Two", @"Three", @"Four", nil]];
  2. topSegmentControl.backgroundColor = [UIColor clearColor];
  3. topSegmentControl.segmentedControlStyle = UISegmentedControlStyleBar;
  4. UIBarButtonItem *toolBarCustom = [[UIBarButtonItem alloc] initWithCustomView:topSegmentControl];
  5. // UIBarButtonItem *spaceItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
  6. self.navigationItem.leftBarButtonItem = toolBarCustom;
  7.  
  8. UISegmentedControl *topSegmentControl = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"BottomOne", @"BottomTwo", @"BottomThree", nil]];
  9. // topSegmentControl.backgroundColor = [UIColor clearColor];
  10. topSegmentControl.segmentedControlStyle = UISegmentedControlStyleBar;
  11. UIBarButtonItem *toolBarCustom = [[UIBarButtonItem alloc] initWithCustomView:topSegmentControl];
  12. UIBarButtonItem *spaceItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
  13. NSArray *array = [NSArray arrayWithObjects:spaceItem, toolBarCustom, spaceItem, nil];
  14. [navController setToolbarItems:toolBarCustom];
  15. [navController setToolbarHidden:NO];
Add Comment
Please, Sign In to add comment