#import "firstView.h"
#import "SecView.h"
#import "ThirdView.h"
#import "FourthView.h"
-(IBAction)tabbar_Click:(id)sender
{
firstView *tocViewController = [[firstView alloc] initWithNibName:@"firstView"bundle:nil];
SecView *bookmarkViewController = [[SecView alloc] initWithNibName:@"SecView"bundle:nil];
ThirdView *searchViewController = [[ThirdView alloc] initWithNibName:@"ThirdView"bundle:nil];
FourthView *aboutUsViewController = [[FourthView alloc]initWithNibName:@"FourthView" bundle:nil];
UINavigationController *tocNavigationController = [[UINavigationController alloc]initWithRootViewController:tocViewController];
UINavigationController *bookmarkNavigationController = [[UINavigationControlleralloc] initWithRootViewController:bookmarkViewController];
UINavigationController *searchNavigationController = [[UINavigationController alloc]initWithRootViewController:searchViewController];
UINavigationController *aboutUsNavigationController = [[UINavigationControlleralloc] initWithRootViewController:aboutUsViewController];
[tocNavigationController.tabBarItem setImage:[UIImage imageNamed:@"data.png"]];
[bookmarkNavigationController.tabBarItem setImage:[UIImageimageNamed:@"bookmark.png"]];
[searchNavigationController.tabBarItem setImage:[UIImageimageNamed:@"search.png"]];
[aboutUsNavigationController.tabBarItem setImage:[UIImageimageNamed:@"info.png"]];
[tocNavigationController.tabBarItem setSelectedImage:[UIImageimageNamed:@"data1.png"]];
[bookmarkNavigationController.tabBarItem setSelectedImage:[UIImageimageNamed:@"bookmark1.png"]];
[searchNavigationController.tabBarItem setSelectedImage:[UIImageimageNamed:@"search1.png"]];
[aboutUsNavigationController.tabBarItem setSelectedImage:[UIImageimageNamed:@"info1.png"]];
[tocNavigationController.tabBarItem setTitle:@"Data"];
[bookmarkNavigationController.tabBarItem setTitle:@"Bookmarks"];
[searchNavigationController.tabBarItem setTitle:@"Search"];
[aboutUsNavigationController.tabBarItem setTitle:@"About Us"];
[tocNavigationController.tabBarItem setTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:
[UIColor blackColor],NSForegroundColorAttributeName,
[UIFont boldSystemFontOfSize:12.0],NSFontAttributeName, nil]
forState:UIControlStateNormal];
[bookmarkNavigationController.tabBarItem setTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:
[UIColor blackColor],NSForegroundColorAttributeName,
[UIFont boldSystemFontOfSize:12.0],NSFontAttributeName, nil]
forState:UIControlStateNormal];
[searchNavigationController.tabBarItem setTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:
[UIColor blackColor],NSForegroundColorAttributeName,
[UIFont boldSystemFontOfSize:12.0],NSFontAttributeName, nil]
forState:UIControlStateNormal];
[aboutUsNavigationController.tabBarItem setTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:
[UIColor blackColor],NSForegroundColorAttributeName,
[UIFont boldSystemFontOfSize:12.0],NSFontAttributeName, nil]
forState:UIControlStateNormal];
UITabBarController *tabBarController = [[UITabBarController alloc] init];
[tabBarController setViewControllers:[NSArrayarrayWithObjects:tocNavigationController,bookmarkNavigationController,searchNavigationController,aboutUsNavigationController, nil]];
UIImage* tabBarBackground = [UIImage imageNamed:@"TabBar-iPhone.png"];
[[UITabBar appearance] setBackgroundImage:tabBarBackground];
tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:tabBarController animated:YES];
}