Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UISegmentedControl *topSegmentControl = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"One", @"Two", @"Three", @"Four", nil]];
- topSegmentControl.backgroundColor = [UIColor clearColor];
- topSegmentControl.segmentedControlStyle = UISegmentedControlStyleBar;
- UIBarButtonItem *toolBarCustom = [[UIBarButtonItem alloc] initWithCustomView:topSegmentControl];
- // UIBarButtonItem *spaceItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
- self.navigationItem.leftBarButtonItem = toolBarCustom;
- UISegmentedControl *topSegmentControl = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"BottomOne", @"BottomTwo", @"BottomThree", nil]];
- // topSegmentControl.backgroundColor = [UIColor clearColor];
- topSegmentControl.segmentedControlStyle = UISegmentedControlStyleBar;
- UIBarButtonItem *toolBarCustom = [[UIBarButtonItem alloc] initWithCustomView:topSegmentControl];
- UIBarButtonItem *spaceItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
- NSArray *array = [NSArray arrayWithObjects:spaceItem, toolBarCustom, spaceItem, nil];
- [navController setToolbarItems:toolBarCustom];
- [navController setToolbarHidden:NO];
Add Comment
Please, Sign In to add comment