Quote:
Originally Posted by pritamsaha
How to add tab bar??
|
#pragma mark - Code to add tab bar
-(void)addTabBar
{
[tabBarControllerHome.view removeFromSuperview];
[tabBarControllerHome release];
tabBarControllerHome =[[UITabBarController alloc]init];
tabBarControllerHome.delegate=self;
NSMutableArray *localControllersArray = [[NSMutableArray alloc] initWithCapacity:3];
UINavigationController *localNavigationController;
BalanceViewController *objBalance = [[BalanceViewController alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewController

bjBalance];
[localControllersArray addObject:localNavigationController];
[objBalance release];
[localNavigationController release];
TransactionViewController *objTransaction = [[TransactionViewController alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewController

bjTransaction];
[localControllersArray addObject:localNavigationController];
[objTransaction release];
[localNavigationController release];
objSupport = [[SupportViewControler alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewController

bjSupport];
[localControllersArray addObject:localNavigationController];
[localNavigationController release];
[tabBarControllerHome setViewControllers:localControllersArray animated:YES];
tabBarControllerHome.selectedIndex=0;
[localControllersArray release];
CGRect frame = CGRectMake(0.0, 0.0, 320, 48);
UIImageView *imgvmyTabView=[[UIImageView alloc]initWithFrame:frame];
imgvmyTabView.image=[UIImage imageNamed:@""];
[[self.tabBarControllerHome tabBar] insertSubview:imgvmyTabView atIndex:0];
[imgvmyTabView release];
[window addSubview:tabBarControllerHome.view];
[window makeKeyAndVisible];
}