Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. - (IBAction)tab1Click:(id)sender {
  2.  
  3. myTabBarController = [[UITabBarController alloc] init];
  4. view2Controller = [[View2Controller alloc] init];
  5. [view2Controller setTitle:@"title"];
  6. view3Controller = [[View3Controller alloc] init];
  7. deneme = [[ViewController alloc] init];
  8.  
  9. myTabBarController.viewControllers = [NSArray arrayWithObjects:deneme, view2Controller,view3Controller, nil];
  10. [self.view addSubview:myTabBarController.view];
  11. myTabBarController.selectedIndex=1;
  12. }
  13.  
  14. [[self.tabBarController.tabBar.items objectAtIndex:0] setTitle:NSLocalizedString(@"BotonMapas", @"comment")];
  15.  
  16. [[self.tabBarController.tabBar.items objectAtIndex:1] setTitle:NSLocalizedString(@"BotonRA", @"comment")];
  17.  
  18. [[self.tabBarController.tabBar.items objectAtIndex:2] setTitle:NSLocalizedString(@"BotonEstado", @"comment")];
  19.  
  20. [[self.tabBarController.tabBar.items objectAtIndex:3] setTitle:NSLocalizedString(@"LabelInfo", @"comment")];
  21.  
  22. // set tab title
  23. self.title = @"Tab Title";
  24. // optionally, set different title for navigation controller
  25. self.navigationItem.title = @"Nav Title";
  26. // Note: self.title will reset Nav Title. Use it first if you want different titles
  27.  
  28. UITabBarItem *item2 = [[UITabBarItem alloc initWithTitle:@"someTitle" image:someImage tag:0];
  29. viewController2.tabBarItem = item2;
  30.  
  31. [view2Controller setTitle:@"ImATitle"];
  32.  
  33. UINavigationController *nav1 = [[UINavigationController alloc] init];
  34. myViewController *myView = [[myViewController alloc] init];
  35. //myView.title = @"Title"; //prob not needed
  36. [nav1 pushViewController: myView animated:NO];
  37. UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:@"Title" image:[UIImage imageNamed:@"title.png"] tag:0];
  38. nav1.tabBarItem = item;
  39. UITabBarController *tbc = [[UITabBarController alloc] init];
  40. tbc.viewControllers = [NSArray arrayWithObjects:nav1, nil];
  41.  
  42. - (IBAction)tab1Click:(id)sender {
  43.  
  44. myTabBarController = [[UITabBarController alloc] init];
  45.  
  46. myTabBarController.delegate = self;
  47.  
  48. view2Controller = [[View2Controller alloc] init];
  49. [view2Controller setTitle:@"title"];
  50. view3Controller = [[View3Controller alloc] init];
  51. deneme = [[ViewController alloc] init];
  52. dename.title = @"Dename";
  53. view2Conreoller.title = @"View2";
  54. view3Conreoller.title = @"View3";
  55. myTabBarController.viewControllers = [NSArray arrayWithObjects:deneme, view2Controller,view3Controller, nil];
  56. [self.view addSubview:myTabBarController.view];
  57. myTabBarController.selectedIndex=1;
  58. }
  59.  
  60. view2Controller.tabBarItem.image = [UIImage imageNamed:@"misle.png"];
  61.  
  62. [(UIViewController *)[tabBarController.viewControllers objectAtIndex:Index] setTitle:@"Title"];
  63.  
  64. UITabBarItem *tabItem = [[[tabBarController tabBar] items] objectAtIndex:INDEX];
  65. [tabItem setTitle:@"TITLEe"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement