3

enter image description here

What would be the best way to make these buttons? I have no problem with the right/left buttons, but this "tab" functionality is eluding me.

I was thinking of adding custom buttons on viewDidLoad like:

UIButton *profileBtn = [[UIButton alloc] initWithFrame:CGRectMake(50, 5, 100, 30)];
[profileBtn setTitle:@"Profile" forState:UIControlStateNormal];
[self.navigationController.navigationBar addSubview:profileBtn];

However, then the buttons stay on the navigation bar until I manually get them off. Surely there is a better/easier way to do something like this? (note that I'm already using the UITabBarController on the bottom of the screen)

Buchannon
  • 1,671
  • 16
  • 28

1 Answers1

1

Make use of the UISegmentedControl. Switch views by adding both in the first place and hide/show accordingly. If that eats up too much memory create them just in time and remove the inactive one from the superview.

Here is a tutorial on the UISegmentedControl.

Nick Weaver
  • 47,228
  • 12
  • 98
  • 108
  • Ahh thanks! The way I have my navigation set up, it was a little bit of a pain to make it work but I got it going now. – Buchannon Apr 27 '11 at 18:43