Possible Duplicate:
Is there anyway to add same scroll menubar at the navigation bar?
May be it is a stupid question but i have to solve it at any cost because my whole project depending on it.My question is,
I have four view controller A, B, C, D.
A has 4 buttons btn1,btn2,btn3,brn4. when i will start click on btn then
btn1 click -> A controller reload or current controller reload;
btn2 click -> B controller open;
btn3 click -> C controller open;
btn4 click -> D controller open;
B has 4 buttons btn1,btn2,btn3,brn4. when i will start click on btn then
btn1 click -> A controller open;
btn2 click -> B controller reload or current controller reload;
btn3 click -> C controller open;
btn4 click -> D controller open;
C has 4 buttons btn1,btn2,btn3,brn4. when i will start click on btn then
btn1 click -> A controller open;
btn2 click -> B controller open;
btn3 click -> C controller reload or current controller reload;
btn4 click -> D controller open;
D has 4 buttons btn1,btn2,btn3,brn4. when i will start click on btn then
btn1 click -> A controller open;
btn2 click -> B controller open;
btn3 click -> C controller open;
btn4 click -> D controller reload or current controller reload;
I need detail process how can i do that?
Thanks In Advance.
EDIT:
All of my these controller (A,B,C,D) are in tabbar controller and buttons are in a scrollview which are at the top of the controller.I have attaching a image of these UI,till now i have done this….

further any query please do not hesitate to ask.
Thanks again
EDIT 2:
This is scrollview of button which i have imported in every controller viewDidload of tabbar items.
scrollButtonView = [[scrollViewButtons alloc] initWithNibName:@"scrollViewButtons" bundle:nil];
CGRect frame = CGRectMake(0, 20, 320, 43);
scrollButtonView.view.frame = frame;
scrollButtonView.view.userInteractionEnabled =YES;
[self.navigationController.view addSubview:scrollButtonView.view];
here is the code where i want to switch the controller on button click.but problem is when i import those A,B,C,D then i found an error Unknown controller
-(void)mybuttons:(id)sender{
NSLog(@"mybuttons called");
UIButton *button=(UIButton *)sender;
if (button.tag == 0) {
NSLog(@"hey have clicked first button, this is my tag : %i \n\n",button.tag);
[button setBackgroundImage:[UIImage imageNamed:@"btn_topmenu_hover.png"] forState:UIControlStateSelected]; //sets the background Image]
}
else {
[button setBackgroundImage:[UIImage imageNamed:@"btn_topmenu_normal.png"] forState:UIControlStateNormal]; //sets the background Image]
}
if (button.tag == 1) {
NSLog(@"hey have clicked second button, this is my tag : %i \n\n",button.tag);
[button setBackgroundImage:[UIImage imageNamed:@"btn_topmenu_hover.png"] forState:UIControlStateNormal]; //sets the background Image]
self.tabBarController.selectedIndex = 1;
}
else if (button.tag == 2) {
NSLog(@"hey have clicked first button, this is my tag : %i \n\n",button.tag);
[button setBackgroundImage:[UIImage imageNamed:@"btn_topmenu_hover.png"] forState:UIControlStateNormal]; //sets the background Image]
//UIViewController *newController = [[UIViewController alloc] initWithNibName:@"CustomerViewController" bundle:nil];
//UINavigationController *myCustomerController = [[[UINavigationController alloc] initWithRootViewController:newController] autorelease];
//UINavigationController *myCustomerController = [[UINavigationController alloc] initWithNibName:@"CustomerViewController" bundle:nil];
UIViewController *secondViewController = [[UIViewController alloc] initWithNibName:@"CustomerViewController" bundle:nil];
[self.navigationController pushViewController:secondViewController animated:YES];
self.tabBarController.selectedIndex = 2;
}
else if (button.tag == 3) {
NSLog(@"hey have clicked second button, this is my tag : %i \n\n",button.tag);
[button setBackgroundImage:[UIImage imageNamed:@"btn_topmenu_hover.png"] forState:UIControlStateNormal]; //sets the background Image]
//[self.navigationController pushViewController:cstViewController animated:YES];
self.tabBarController.selectedIndex = 3;
}
}
EDIT3:
Any way i have to solve the problem so i have tried a lot of way but i missed a simple matter. when i want to change the tap bar then then also i am getting these buttons so i have solved this problem a little bit different way..see my answer you will get the answer..
further any question pls ask. Any how i have to solve the problem.
Thanks In Advance.
Have you considered using a UITabBarController – that implements the functionality you are describing.
The buttons in the scroll view just replicates the tab bar functionality – resulting in a confusing user experience.