Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 9    Views: 57

stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
11/16/13 05:12 PM (12 years ago)

Don't want landscape on any device

Just submitted an app and realized that, even though I made it restricted to portrait on the iphone through BT, since there is no way in BT to restrict it on the ipad, the screen does indeed rotate. However, when it does so it screws up my screens which work perfectly in portrait. What can I do to disallow the use of landscape on the ipad? I don't care if portrait works upside down or not, just want landscape to go away for any update. I see in Xcode under Target, General, Development Info, Device Orientation, there are choices to check for portrait, upside down, landscape right and landscape left. Does unchecking them do the trick? Thanks. Steve
 
shenry
Aspiring developer
Profile
Posts: 469
Reg: Jan 10, 2012
Orange County, ...
13,390
like
11/16/13 09:59 PM (12 years ago)
I'm not sure if this is the best fix, but in your BT_Info.plist there is an array called "Supported interface orientations". Remove both landscape values from the array and your app should be locked in portrait orientation.
 
stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
like
11/16/13 10:14 PM (12 years ago)
Shenry, Don't see how that will work since when I set up the app in BT I set no rotations in small devices, since I could. And indeed, my iphone does not allow rotations, as you would expect. However, when I go to the plist, all rotations ARE listed in Supported interface orientations for the iphone - Portrait, Portrait upside down, Landscape, Landscape Left and Landscape Right. So I don't see how messing with this array will change anything since it already seems to make no sense. Steve
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/17/13 02:10 AM (12 years ago)
I'm playing around with the BTv3 core for iOS, and some of the filenames have changed slightly. Regardless, find the BT_viewController.m file, or the closest thing to it. These will be in the 'Layout' directory. Scroll down a bit to around line 1470-ish until you see the method 'shouldAutorotateToInterfaceOrientation'. When you find that, there 'should' be a statement along the lines of: "BOOL canRotate = TRUE;" Change that canRotate from TRUE to FALSE and give it a whirl. Filenames and methods may not be 'exactly' the same, but the code will be darn similar. Thats what you want to look for. Cheers! -- Smug
 
stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
like
11/17/13 07:07 AM (12 years ago)
Smug, No dice. Changed that one and another below it from True to False and still rotates, at least on the simulator. Haven't tested on real device but figure if does it on simulator will do it on real. Also see, however, that entry in BT_Layout/BT_rotatingTabBarController.m: Should I change it there too? Steve
 
tb
buzztouch Evangelist
Profile
Posts: 2050
Reg: Nov 03, 2011
Oxford
32,300
like
11/17/13 01:39 PM (12 years ago)
I think it should just be a tiny little change like Smug says. With my apps, it's one line of code.
 
stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
like
11/17/13 02:17 PM (12 years ago)
Wouldn't mind knowing what that one line is because I've changed every instance (3 of them) of rotate = TRUE to FALSE in BR_viewController.m and still no go. Tried it with already published apps too, still allows rotations. Also tried on actual device, not just simulator.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/17/13 03:44 PM (12 years ago)
"BOOL canRotate = TRUE;" <-- That's the one line. Try it in all the files in your Layout directory within your project. It's bound to be one of them. ;) Cheers! -- Smug
 
stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
like
11/17/13 04:50 PM (12 years ago)
Thanks, Smug, but no go. I first found all occurrences of BOOL canRotate = TRUE (there were 3) and changed them to FALSE. Still rotates. Then I searched for additionally, all occurrences of just canRotate = TRUE, there were three others, changed them to FALSE, still no good. Steve
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
01/20/14 10:52 AM (11 years ago)
Did anyone find a solution to this. I also changed every instance of "BOOL canRotate = TRUE;" to"BOOL canRotate = FALSE;" , cleaned the app in xcode, rebuilt it and still every screen in my iPhone iOS7 continues to rotate. Anyone?
 

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.