Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Aug 6, 2010, 04:56 PM   #1
Danneman101
macrumors 6502
 
Join Date: Aug 2008
Auto-rotating intro-screen not working [ipad]

Ive got an intro-view that appears right after the splash-screen, and that is loaded from the didFinishLaunchingWithOptions in the AppDelegate.m-file.

Problem is it wont rotate when the device rotates. This despite the fact that the splash-screen rotates fine to the selected orientation, and that the info-file supports all 4 rotations.

Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
	[window addSubview:splitViewController.view];
	[window makeKeyAndVisible];

	// Create intro-screen, with some nick-nacks not included here
	CGSize screenSize = [UIScreen mainScreen].bounds.size;
	CGRect screenBounds = CGRectMake(0, 0, screenSize.width, screenSize.height);	
	introView = [[UIView alloc] initWithFrame:screenBounds];	
	[window addSubview:introView];

	return YES;	
}
Any idea as to what might be causing it?
Danneman101 is offline   0 Reply With Quote
Old Aug 6, 2010, 06:38 PM   #2
PhoneyDeveloper
macrumors 68030
 
PhoneyDeveloper's Avatar
 
Join Date: Sep 2008
There's a reason that apple invented view controllers. Make your view and view controller part of the view controller hierarchy and it should work.

Last edited by PhoneyDeveloper; Aug 6, 2010 at 07:07 PM.
PhoneyDeveloper is offline   0 Reply With Quote
Old Aug 8, 2010, 07:11 AM   #3
Danneman101
Thread Starter
macrumors 6502
 
Join Date: Aug 2008
I see - only a viewcontroller can handle auto-rotation of views, whereas auto-rotating the default.png is a totally separate issue.

In my case, having a splitviewcontroller-app, the solution was simply to utilize that viewcontroller instead of making a new one. So, instead of adding the view to the window, I added it to the splitviewcontroller as such:

Code:
[splitViewController.view addSubview:introView];
Thanks for the input.
Danneman101 is offline   0 Reply With Quote
Old Aug 8, 2010, 01:29 PM   #4
PhoneyDeveloper
macrumors 68030
 
PhoneyDeveloper's Avatar
 
Join Date: Sep 2008
Very good. I don't really know why but a lot of developers think they can avoid view controllers.
PhoneyDeveloper is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iPad Mini: iPad rMini screen not rotating from landscape to portrait ezhilk iPad 7 Feb 18, 2014 09:43 PM
All iPads: iPad Air auto screen rotation problem agkm800 iPad 0 Nov 28, 2013 01:15 AM
IOS 7 - NO ROTATING SCREEN in Music app pr0230 iPod touch 1 Nov 10, 2013 08:41 PM
iOS 6 screen not rotating McGiord iOS 6 6 Nov 3, 2012 09:31 PM
iPad: Auto-Brightness not working on new iPad? Black Dawg Down iOS 6 6 Sep 23, 2012 09:45 AM

Forum Jump

All times are GMT -5. The time now is 01:34 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC