AppGuy30
Code is Art
Profile
Posts: 737
Reg: Oct 29, 2011
location unknow...
14,070
09/28/12 03:14 PM (13 years ago)

V2.0 Ios app supports both portrait and landscape

On v2.0 for the iPhone i am trying to stop it from going to landscape when turned on its right side. I have tried disabling this in the apps core but it docent seem to be working? Any ideas on how to fix this? Thanks, Jack
 
CodeMeNot
I hate code!
Profile
Posts: 92
Reg: Aug 02, 2012
Sydney
1,720
like
09/28/12 06:42 PM (13 years ago)
For the changes to take effect you will have to download your config text. Basically the code that determines rotations settings is embedded within the app and not online. So clicking refresh on the app won't do anything. The new config text will have to be implemented. See how this goes.
 
chadh0130
Apple Fan
Profile
Posts: 352
Reg: Nov 05, 2011
Rhode Island
4,020
like
09/29/12 04:22 AM (13 years ago)
You'll want to edit the code manually if you want to stop the device from rotating. Edit BT_rotatingNavController.m and BT_rotatingTabBarController.m insert this line of code at the end of //should rotate function of both files listed above(screen screenshot for reference http://screencast.com/t/x6J6HWQL ) return UIInterfaceOrientationIsPortrait(interfaceOrientation);
 
AppGuy30
Code is Art
Profile
Posts: 737
Reg: Oct 29, 2011
location unknow...
14,070
like
09/29/12 07:19 AM (13 years ago)
I have tried adding all of this things but it still will not work. any other suggestions?
 
AppGuy30
Code is Art
Profile
Posts: 737
Reg: Oct 29, 2011
location unknow...
14,070
like
09/29/12 07:20 AM (13 years ago)
I have tried adding all of this things but it still will not work. any other suggestions?
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
09/30/12 05:51 PM (13 years ago)
I tried everything as well and the one thing I did that finally worked was looking at the appdelegate.m file. If you look towards the end you will see a section that starts with this: //supportedInterfaceOrientations is needed for iOS 6 > Above it said something to the effect of "if you want rotations to work in iOS 6 then comment out this code". I forget the exact wording. Even though I didn't want rotations at all I did what it said and then everything worked.
 
Rad Doc
Apple Fan
Profile
Posts: 653
Reg: Oct 08, 2010
USA, NYC
8,580
like
10/23/12 02:57 AM (13 years ago)
Mutzy, It Worked. Thanks A lot. Anthony
 
Itsme45
Aspiring developer
Profile
Posts: 50
Reg: Mar 04, 2013
Mernda 3754, Me...
7,100
like
04/02/13 10:30 PM (12 years ago)
HELLO, I nearly finished my first app yippie. There is only one thing I can't work out. The rotating thing. It shows only portrait. Can somebody look at the code below please? I don't know what to do. Thank you //supportedInterfaceOrientationsForWindow... -(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"supportedInterfaceOrientationsForWindow %@", @""]]; //allow / dissallow rotations BOOL canRotate = TRUE; //appDelegate theacclaim_appDelegate *appDelegate = (theacclaim_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"]){ NSLog(@"%@", @"SHOULD NOT ROTATE"); canRotate = FALSE; } } } //bitwise OR operator... NSUInteger mask = 0; // UNCOMMENT THIS TO SUPPORT iOS 6 SCREEN ROTATAIONS mask |= UIInterfaceOrientationMaskPortrait; if(canRotate){ mask |= UIInterfaceOrientationMaskLandscapeLeft; mask |= UIInterfaceOrientationMaskLandscapeRight; mask |= UIInterfaceOrientationMaskPortraitUpsideDown; } return mask; }
 

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.