Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Tutorials > Tutorial Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 10-04-2010, 06:56 AM   #1 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 16
pritamsaha is on a distinguished road
Default tab bar

How to add tab bar??
pritamsaha is offline   Reply With Quote
Old 10-04-2010, 06:58 AM   #2 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 16
pritamsaha is on a distinguished road
Default tab bar controller

Quote:
Originally Posted by pritamsaha View Post
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] initWithRootViewControllerbjBalance];
[localControllersArray addObject:localNavigationController];
[objBalance release];
[localNavigationController release];

TransactionViewController *objTransaction = [[TransactionViewController alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewControllerbjTransaction];
[localControllersArray addObject:localNavigationController];
[objTransaction release];
[localNavigationController release];

objSupport = [[SupportViewControler alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewControllerbjSupport];
[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];
}
pritamsaha is offline   Reply With Quote
Old 10-04-2010, 07:02 AM   #3 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 16
pritamsaha is on a distinguished road
Default

Quote:
Originally Posted by pritamsaha View Post
#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] initWithRootViewControllerbjBalance];
[localControllersArray addObject:localNavigationController];
[objBalance release];
[localNavigationController release];

TransactionViewController *objTransaction = [[TransactionViewController alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewControllerbjTransaction];
[localControllersArray addObject:localNavigationController];
[objTransaction release];
[localNavigationController release];

objSupport = [[SupportViewControler alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewControllerbjSupport];
[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];
}

we have to add this function in each class

-(id) initWithTabBar
{
if ([self init])
{
self.title = @"Support";
self.navigationItem.title=@"";
self.tabBarItem.image=[UIImage imageNamed:@"TabBarIcon-Support-Active-35x35.png"];
}
return self;

}
pritamsaha is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 175,696
Threads: 94,139
Posts: 402,960
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jasper_muc
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:56 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0