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 Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-26-2009, 06:43 AM   #1 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 5
Strzalek is on a distinguished road
Default UITabBarController frame problem

Hello,

I have problem with UITabBarController.

When I'm initialize UITabBarController in application delegate and add as subView of window it's ok.

But when I want move all UITabBarController initialization stuff to MainViewController and it's loadView method, then in Application Delegate add as subview:

Code:
MainViewController *mainView = [[MainViewController alloc] init];
mainView.view.frame = [UIScreen mainScreen].applicationFrame;
[window addSubview:mainView.view];
The aplication appear on screen like this:



Again - when do all without wrapping in MainViewController it's ok.

What's the problem?
Strzalek is offline   Reply With Quote
Old 05-26-2009, 08:22 AM   #2 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 5
Strzalek is on a distinguished road
Default

The code with which I'm creating TabBar:

Code:
- (void)loadView
{
	[super loadView];
	tabBarController = [[UITabBarController alloc] init];
    
    // Create a few view controllers
    UIViewController *redViewController = [[UIViewController alloc] init];
    redViewController.title = @"Blipsfera";
    redViewController.tabBarItem.image = [UIImage imageNamed:@"all.png"];
    redViewController.view.backgroundColor = [UIColor redColor];
	
    UIViewController *blueViewController = [[UIViewController alloc] init];
    blueViewController.title = @"Blue";
    blueViewController.tabBarItem.image = [UIImage imageNamed:@"all.png"];
    blueViewController.view.backgroundColor = [UIColor blueColor];
    
    DashboardViewController *myViewController = [[DashboardViewController alloc] init];
	myViewController.title = @"test";
	myViewController.tabBarItem.image = [UIImage imageNamed:@"all.png"]; 
    
    tabBarController.viewControllers = [NSArray arrayWithObjects:redViewController, blueViewController, myViewController, nil];
	
    [redViewController release];
    [blueViewController release];
    [myViewController release];
	
	[self.view addSubview:tabBarController.view];
}
Strzalek is offline   Reply With Quote
Old 05-26-2009, 04:18 PM   #3 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 5
Strzalek is on a distinguished road
Default

Anybody?
Strzalek is offline   Reply With Quote
Old 08-28-2009, 03:42 AM   #4 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 2
pyrodize is on a distinguished road
Default

Quote:
Originally Posted by Strzalek View Post
The code with which I'm creating TabBar:

Code:
- (void)loadView
{
	[super loadView];
	tabBarController = [[UITabBarController alloc] init];
    
    // Create a few view controllers
    UIViewController *redViewController = [[UIViewController alloc] init];
    redViewController.title = @"Blipsfera";
    redViewController.tabBarItem.image = [UIImage imageNamed:@"all.png"];
    redViewController.view.backgroundColor = [UIColor redColor];
	
    UIViewController *blueViewController = [[UIViewController alloc] init];
    blueViewController.title = @"Blue";
    blueViewController.tabBarItem.image = [UIImage imageNamed:@"all.png"];
    blueViewController.view.backgroundColor = [UIColor blueColor];
    
    DashboardViewController *myViewController = [[DashboardViewController alloc] init];
	myViewController.title = @"test";
	myViewController.tabBarItem.image = [UIImage imageNamed:@"all.png"]; 
    
    tabBarController.viewControllers = [NSArray arrayWithObjects:redViewController, blueViewController, myViewController, nil];
	
    [redViewController release];
    [blueViewController release];
    [myViewController release];
	
	[self.view addSubview:tabBarController.view];
}
how about change
Code:
[self.view addSubview:tabBarController.view];
into
Code:
self.view = tabBarController.view;
pyrodize is offline   Reply With Quote
Reply

Bookmarks

Tags
application delegate, uitabbarcontroller

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
» Online Users: 340
6 members and 334 guests
givensur, ipodphone, jbro, mer10, n00b, yomo710
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,881
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

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