Discussion Forums  >  Uncategorized

Replies: 21    Views: 569

baywebnz
Aspiring developer
Profile
Posts: 92
Reg: Oct 25, 2010
location unknow...
920
02/09/11 03:48 PM (13 years ago)

Fix a screen orientation

Is it possible (in v1.5) to fix a particular screens orientation? i.e keep it in portrait even when the iphone is physically rotated? Been looking through the xcode project and found various references to 'autorotate' but not sure where to go from here?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/09/11 05:12 PM (13 years ago)
This is a good question. Managing screen rotation on a screen-by-screen basis isn't possible without major programming kung-fu. The current setup supports screen rotations for all the screens. You could easily PREVENT the orientation from rotating but it would prevent it for ALL SCREENS, not just a few. It seems like it would be any easy adjustment to control how one screen rotates but it's not. It's horribly complex because most apps are using the Tabbed layout. The tabbed layout is what makes it difficult. We do hope to figure this out and allow you to control rotation on a screen-by-screen basis but it won't be for awhile (at best). You could do some research (Google) and try to get a deeper understanding as to how this is working. Search UITabBarController and screen orientation. The way this is working now is this: All screens are sub-classes of the BT_rotatingNavController controller. In this class, you'll see a canRotate setting (current set to 1). Setting this to zero AND setting the same flag in BT_rotatingTabBarController will prevent it from rotating. If you can figure out how to control one screen - post your finding for others.
 
baywebnz
Aspiring developer
Profile
Posts: 92
Reg: Oct 25, 2010
location unknow...
920
like
02/09/11 07:09 PM (13 years ago)
Ok thanks David - will probably prevent rotation for all screens in this app since portrait suits this particular app better. Cheers
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
02/15/11 02:41 AM (13 years ago)
Hello David. I tested the change in both BT_rotatingNavController.m and BT_rotatingTabBarController.m to zero, but it still rotates. what am I doing wrong?
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
02/15/11 02:44 AM (13 years ago)
I fixed it!
 
Irishaisle
Aspiring developer
Profile
Posts: 53
Reg: Nov 22, 2010
location unknow...
530
like
02/28/11 06:54 PM (13 years ago)
what did you do to fix this. Mine is still rotating. And do you also have to set the if statement ==0 which is right underneath the initial?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/28/11 07:49 PM (13 years ago)
To prevent the screen from rotating for ALL screens, there are tow files that needed adjusted. Both need the same easy change, both are in the BT_Layout folder. BT_rotatingNavController BT_rotatingTabBarController In each of these files, set BOOL canRotate = 1; to 0 (1 is yes, zero is no). Your code will look like this when done BOOOL canRotate = 0; Again, do this in both files and nothing will rotate. I have not tested this on iPad.
 
appvision
Aspiring developer
Profile
Posts: 139
Reg: Jan 20, 2011
location unknow...
1,390
like
05/23/11 04:48 AM (12 years ago)
Has this been changed with the recent update? How do I prevent rotation for all screens on small devices? Thanks.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/23/11 10:00 AM (12 years ago)
SYes, the prevent screen rotation option was added recently, a few weeks ago. ee the change log in a v1.5 app control panel if you're unsure about when your project source-code was last changed.
 
appvision
Aspiring developer
Profile
Posts: 139
Reg: Jan 20, 2011
location unknow...
1,390
like
05/23/11 12:00 PM (12 years ago)
The update does not offer an option to prevent rotation on small devices. How can this be done? Thanks.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/24/11 12:44 AM (12 years ago)
Core Settings > Allow Rotation. Choose 'only large devices allow rotations' means DONT allow rotations on small devices. Same thing as 'prevent' rotation on small devices.
 
appvision
Aspiring developer
Profile
Posts: 139
Reg: Jan 20, 2011
location unknow...
1,390
like
05/24/11 04:04 AM (12 years ago)
How do I prevent rotation on large devices? Thanks.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/24/11 09:20 PM (12 years ago)
You can't prevent rotation on large devices from the control panel - iPads will always rotate. You could prevent this by hacking in the source. It's an easy change in two files. Return 'NO' instead of 'YES' in the shouldAutorotateToInterfaceOrientation method. Do this in two files: BT_Layout > BT_rotatingNavController.m BT_Layout > BT_rotatingTabBarController.m
 
MyPC Solutions
buzztouch Evangelist
Profile
Posts: 65
Reg: Sep 19, 2011
Colorado Spring...
1,450
like
10/01/11 04:10 PM (12 years ago)
How do I allow all my screens to rotate in v1.4?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
10/02/11 07:56 PM (12 years ago)
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
01/11/12 05:22 PM (12 years ago)
Hi David, I've been looking en trying (for hours and hours) to accomplish my whish to set a (specific) screen to only landscape mode. Is there any progress on this?? If needed I am willing to pay for it!!! It could be a (temporary) solution to hardcode it (no problem) but it would be great if every screen in advanced details would get an option for this. Hope to hear soon from you 'cause I (and think many others) really need this feature. Thanks in advance and Best Regards, Danny
 
Stobe
buzztouch Evangelist
Profile
Posts: 1527
Reg: Mar 04, 2011
Fredericksburg,...
24,670
like
01/13/12 12:21 PM (12 years ago)
replying for the sake of subscribing to this thread. It seems to be very pertinent to my most recent app.
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
02/03/12 09:44 AM (12 years ago)
Digging up an old post, however this one is reference quite a bit. What would be the steps to prevent landscape in android. I think it has to do with BT_Device but want to make sure. Not seeing the other calls described here anywhere in the android source. Thanks
 
Don Javi
Aspiring developer
Profile
Posts: 91
Reg: Oct 08, 2011
Burriana
910
like
02/20/12 06:40 AM (12 years ago)
Sorry, I have a rejection and an application for not allowing vertical rotation. I accept that blocks the horizontal rotation but I allow rotation of the vertical ipad (home button above) - The reason for rejection is 10.1. Can you help me please!
 
JB
Lost but trying
Profile
Posts: 3
Reg: Sep 19, 2012
miami
1,030
like
01/29/13 01:07 PM (11 years ago)
Can anyone tell me if it's possible to have an app stay in landscape mode permanently?
 
JB
Lost but trying
Profile
Posts: 3
Reg: Sep 19, 2012
miami
1,030
like
01/29/13 01:51 PM (11 years ago)
Can anyone tell me if it's possible to have an app stay in landscape mode permanently?
 
JB
Lost but trying
Profile
Posts: 3
Reg: Sep 19, 2012
miami
1,030
like
01/29/13 02:21 PM (11 years ago)
Can anyone tell me if it's possible to have an app stay in landscape mode permanently?
 

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.