Discussion Forums  >  Uncategorized

Replies: 2    Views: 221

jackreeves
I hate code!
Profile
Posts: 10
Reg: Jun 29, 2011
keighley
100
09/20/11 05:57 PM (14 years ago)

iPad Apps Must Rotate atleast 180 degrees?

Hello All, You previously helped me stop my ipad app rotating (see http://www.buzztouch.com/forum/thread.php?tid=1A84D498A61F7E6361428D9) Now, its 99.9% finished and i was just going over common rejection errors to make sure i get in first time and i came across a few posts saying that ipad apps must be able to rotate... most include that a 180 rotation is enough. So i guess the question is - how true are these reports...should i be worried? And if so whats the best/easiest way to make my ipad display in portrait and upside down portrait. Regards and thanks again in advance. Jack
 
jackreeves
I hate code!
Profile
Posts: 10
Reg: Jun 29, 2011
keighley
100
like
09/21/11 04:02 AM (14 years ago)
Figured it out...add the line return UIInterfaceOrientationIsPortrait(interfaceOrientation); to both rotatingnavcontroller.m and rotatingtabcontroller.m so it now reads. //should rotate -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { //[BT_debugger showIt:self:[NSString stringWithFormat:@shouldAutorotateToInterfaceOrientation %@, @]]; return UIInterfaceOrientationIsPortrait(interfaceOrientation); //allow / dissallow rotations BOOL canRotate = TRUE; //appDelegate ttrapp_appDelegate *appDelegate = (ttrapp_appDelegate *)[[UIApplication sharedApplication] delegate]; if([appDelegate.rootApp.rootDevice isIPad]){ canRotate = TRUE; }else{ //should we prevent rotations on small devices? if([appDelegate.rootApp.jsonVars objectForKey:@allowRotation]){ if([[appDelegate.rootApp.jsonVars objectForKey:@allowRotation] isEqualToString:@largeDevicesOnly]){ canRotate = FALSE; } } } //can it rotate? if(canRotate){ return YES; }else{ return (interfaceOrientation == UIInterfaceOrientationPortrait); } //we should not get here return YES; } Anyone see any problem with this? Works fine in simulator. jack
 
CodeMeNot
I hate code!
Profile
Posts: 92
Reg: Aug 02, 2012
Sydney
1,720
like
09/15/12 06:00 AM (13 years ago)
Jack! Awesome post. Got the 180 working simply. Just so you know. It works on the actual iPad device as well! so nice work. Often something works on simulator but is a totally different story on the actual device. 180 degree rotate should be enough I believe to be accepted. Good luck. Thanks!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.