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 02-16-2011, 05:51 PM   #1 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 33
cjor10 is on a distinguished road
Question App with tabBar not rotating

Hi I have a splitview app that is working fine until I add a TabBar in the rootview section. The problem is that when I add the TabBar to the rootview the app does not rotate to landscape, if I change the orientation the view remains in portrait mode.
How can I solve this?. Hope you can help
Here's my code
Code:
#import "SplitViewTest3AppDelegate.h"
#import "SISACWelcomeViewController.h"

@implementation SplitViewTest3AppDelegate

@synthesize window, masterViewController, splitViewController,masterViewTabBarController, searchViewController;


#pragma mark -
#pragma mark Application lifecycle

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
	
    // Override point for customization after application launch.
	
	masterViewController = [[MasterViewController alloc] initWithStyle:UITableViewStyleGrouped];
    UINavigationController *masterNavigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
	masterNavigationController.tabBarItem.image = [UIImage imageNamed:@"Folder.png"];
    

	
	
	
	//NewsFeedsNavigationController *newsFeedsNavigationController = [[NewsFeedsNavigationController alloc] init];
	SISACWelcomeViewController *sisacWelcomeViewController = [[SISACWelcomeViewController alloc] init];
	UINavigationController *detailNavigationController = [[UINavigationController alloc] initWithRootViewController:sisacWelcomeViewController];
	
	
	searchViewController = [[UIViewController alloc] initWithNibName:@"SearchView" bundle:nil];
	searchViewController.tabBarItem.image = [UIImage imageNamed:@"Search-icon.png"];
	
	masterViewTabBarController = [[UITabBarController alloc] init];
	masterViewTabBarController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, searchViewController, nil];

	
	
	
	masterViewController.detailNavigationController = detailNavigationController;	
    
	splitViewController = [[UISplitViewController alloc] init];

    splitViewController.viewControllers = [NSArray arrayWithObjects:masterViewTabBarController, detailNavigationController, nil];
    
	splitViewController.delegate = sisacWelcomeViewController;
	
    // Add the split view controller's view to the window and display.
    [window addSubview:splitViewController.view];
	//[masterNavigationController.view addSubview:tab.view];
    [window makeKeyAndVisible];
	
	
	
    return YES;

}


- (void)applicationWillResignActive:(UIApplication *)application {
    /*
     Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
     Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
     */
}


- (void)applicationDidBecomeActive:(UIApplication *)application {
    /*
     Restart any tasks that were paused (or not yet started) while the application was inactive.
     */
}


- (void)applicationWillTerminate:(UIApplication *)application {
    /*
     Called when the application is about to terminate.
     */
}


#pragma mark -
#pragma mark Memory management

- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
    /*
     Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.
     */
}



- (void)dealloc {
    [window release];
	//[tab release];
    [super dealloc];
}


@end
cjor10 is offline   Reply With Quote
Old 02-16-2011, 10:57 PM   #2 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Pune, India
Posts: 314
Akshay Shah is on a distinguished road
Send a message via Skype™ to Akshay Shah
Smile

Try this:
Subclass UITabbarController and override the shouldAutorotateForDeviceOrientation method for landscape.
And then use this class instead of UITabbarController.
Hopefully that would solve your problem...

Thanks and Regards,
Akshay Shah.
__________________
If you think I did help you, you can always thank me by buying
iHoldMore - A very nice and addictive game...

Need a mobile app. Contact Us.
Ruby Solutions Pvt. Ltd.
You can mail me at akshay@ruby-solutions.com
Akshay Shah is offline   Reply With Quote
Old 02-17-2011, 12:14 AM   #3 (permalink)
Super Moderator
 
Join Date: Oct 2009
Location: San Diego, CA
Posts: 1,586
JasonR is on a distinguished road
Default

If you read the documentation, it says that the tabbarcontroller queries all the root viewcontrollers used by all the tabs. Only if all the root controllers allow landscape will the tabbar change. So you need to check all the viewcontrollers to make them support landscape.
JasonR 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
» Online Users: 362
11 members and 351 guests
cpsclicker, dre, Error404, gmarro, jeroenkeij, Kirkout, Music Man, PavelMik, teebee74, whitey99
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,666
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cpsclicker
Powered by vBadvanced CMPS v3.1.0

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