Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 26    Views: 80

MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
09/25/12 11:14 AM (13 years ago)

Rotation Problem

Hello, I noticed that with the new package created to deal with IOS 6, the rotation limitation does not work. Selecting in the core properties to only allow large devices to rotate, does prevent any device from rotating. And the BT_rotatingTabBarController is diferent, so I dont have to option to prevent rotation from there (as far as my knowledge goes). Can any help out? Cheers. Miguel
 
tb
buzztouch Evangelist
Profile
Posts: 2050
Reg: Nov 03, 2011
Oxford
32,300
like
09/25/12 12:05 PM (13 years ago)
What BT Version have you used? I think I heard David talk about iOS 6 orientation problems. He says he's working hard (and I believe he is) to fix this. But only under V2.0.
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
09/25/12 12:32 PM (13 years ago)
Hey yet its V2.0 Thanks for the info. Cheers. Miguel
 
tb
buzztouch Evangelist
Profile
Posts: 2050
Reg: Nov 03, 2011
Oxford
32,300
like
09/25/12 12:41 PM (13 years ago)
Right. David did say that with new changes, it brings opportunity: which is good. However, he did say it was temporarily a pain! Just wait a few weeks. It should be sorted. I won't say stuff that I haven't heard from David myself, but I can assure you he did bring this issue up somewhere else. If only I had a link.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
09/25/12 12:46 PM (13 years ago)
If you were to set BT to allow rotation and go into xcode to disable landscape (or portrait, whichever you prefer), that should work. IOS only though.
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
09/25/12 12:58 PM (13 years ago)
I believe so, I just dont seem to find where I disable it in Xcode. :-( Thanks. Miguel
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
09/25/12 01:05 PM (13 years ago)
I am not on my mac, but from memory, you need ot be on the summary screen (right hand pane). Click on the iPhone landscape icons and they become greyed out. It is as easy as that! Scroll down to disable for ipad.
 
tb
buzztouch Evangelist
Profile
Posts: 2050
Reg: Nov 03, 2011
Oxford
32,300
like
09/25/12 01:08 PM (13 years ago)
It's under Targets
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
09/25/12 02:54 PM (13 years ago)
I am having the same problem. The coding is different from 1.5. There is a new section in the appdelegate.m file towards the bottom that also discusses rotation for iOS 6 but even when I set that to false it still rotates!
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
09/25/12 03:21 PM (13 years ago)
I'd use to go to BT_rotatingNavController.m and BT_rotatingTabBarController.m and where it says "if([appdelegate.rootApp.rootDevice isIPad]){canRotate = TRUE;" Just input FALSE and it worked like a charm. As AlanMac suggests, never worked for me. Thanks. Miguel
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
09/26/12 01:10 AM (13 years ago)
Must be I haven't explained it properly, but it works for me. If you have Xcode open in the standard project view, select Targets (not Project) and on the pane to the right you should see Supported Device Orientations on view and four icons on display beneath it, labelled :- Portrait, Upside Down, Landscape Left and Landscape Right. If they are enabled (dark grey), Xcode permits these options. If you click to disable Landscape Left and Landscape Right, your app will stay in Portrait mode. I have done a test today, it works 100% and overrides the app configuration; i.e. if you app wants to allow rotation but the setting here is disabled, then the app doesn't rotate. Scroll below the app icons and you will see the same repeated for iPad orientations - many people don't get this far! Hope this helps, Alan
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
09/26/12 07:02 AM (13 years ago)
I think part of the problem is I am relying on the simulator for iPad. Despite doing what AlanMac and others above have recommended both the iPhone and iPad simulators continue to rotate. however when I install on my actual iPhone it does not rotate. I guess I'll have to track down a physical iPad to see if it's rotating or not.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
09/26/12 08:07 AM (13 years ago)
Yes, the it does seem that the simulator doesn't seem to behave the same as the device here.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
09/28/12 09:54 AM (13 years ago)
I just got hold of an iPad and my method doesn't stop rotation - Buzztouch overrides the XCode setting! Arggh! I followed @MadRod's advice and the only place I needed to edit was BT_rotatingTabBarController.m and on line 85 I changed canRotate to FALSE and it did the trick, (and on a simulator too). Thanks Miguel and sorry of I wasted anyone's time with incorrect advice (it works on PhoneGap apps, honest) - I'm always learning on this forum.
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
09/28/12 10:00 AM (13 years ago)
Hi all, Be carefull with this! If you completely lock the orientation on the iPad it is most likely that Apple will not approve your app. You always have to allow two rotations: portrait up and down, landscape up and down or all. That's what I've found. Best regards, Danny
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
09/28/12 10:15 AM (13 years ago)
Hmm, so how does one stop the app going into landscape mode but allow portrait upside down? My suggestion doesn't seem to work on a buzztouch app and @MadRod's advice stops rotation completely!
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
09/28/12 10:15 AM (13 years ago)
Thats what I did, but for some reason it does not work for me. It still rotates. Cheers. Miguel
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
10/24/12 06:59 AM (13 years ago)
Hey, I found the solution in the forum. In your appdelegate.m just need to find and uncomment //supportedInterfaceOrientations is needed for iOS 6 Cheers. Miguel
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
11/07/12 08:46 PM (13 years ago)
Hi Miguel, Can explain which lines you commented out .... I've got an iphone only iOS project that I can't stop rotations! I've tried setting the project "Supported Interface Orientations" following what AlanMac said about the "standard project view". I've tried setting the control panel core properties to "Only Large Device allows rotation". I've tried setting appdelegate.m file at line 966 to //allow / dissallow rotations BOOL canRotate = FALSE; I've tried doing the same as above at line 80 in the BT_rotatingTabBarController.m Still no luck!! I wouldn't be too concerned except I want to submit this app and every time the image gallery rotates it crashes the app :((( Any help appreciated. Cheers Darrel
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
11/07/12 08:53 PM (13 years ago)
Hmmm... I think I may have an old project that was downloaded before the iOS 6 updates. I'll re-download the source and see if that fixes it.
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
11/07/12 09:44 PM (13 years ago)
Downloaded new source code ... same issues, the bugger still rotates! Thoughts ....
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
11/07/12 09:55 PM (13 years ago)
Solved it! I thought I should finish this conversation with myself ;) Open the appdelegate.m around line 986 is says: /* UNCOMMENT THIS TO SUPPORT iOS 6 SCREEN ROTATAIONS mask |= UIInterfaceOrientationMaskPortrait; if(canRotate){ mask |= UIInterfaceOrientationMaskLandscapeLeft; mask |= UIInterfaceOrientationMaskLandscapeRight; mask |= UIInterfaceOrientationMaskPortraitUpsideDown; } */ You need to get rid of the commenting code, the /* and the */ to activate this code. I thought "TO SUPPORT iOS 6 SCREEN ROTATIONS" meant it would activate rotations (which I don't want), but in actual fact it activates the iOS 6 rotations so it does obey the control panel core properties.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
11/08/12 01:30 AM (13 years ago)
Nice spot @ictguy. I noticed that my latest projects I could not stop rotations using the control panel and I must admit, I had just accepted it for the time being. Now, if only I could stop screen rotations on Android...
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
11/08/12 01:44 AM (13 years ago)
Hey, good to know you solved it. Cheers Miguel
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
11/08/12 03:08 AM (13 years ago)
Thanks guys ... nice to know you are following along! @Miguel your last piece of advice was right but is just seemed conter-intuitive to "Support rotations on iOS 6" when I wanted them to stop :) @AlanMac which devices on Android do you mean? Just the tablets or the phones as well? Cheers
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
11/08/12 03:59 AM (13 years ago)
Gday @ictguy, I'd like to do phones and tablets, but it is (probably?) more important for phones.
 
WebNevees
Code is Art
Profile
Posts: 206
Reg: Oct 28, 2012
KL
11,660
like
12/20/12 06:45 AM (13 years ago)
Hi guys, I followed up on this thread and made some edits of my own, which has been almost successful. Ideally I need to stop all rotations for iPhone (iOS 5 and 6) but allow for iPad rotation just as Portrait layout and UpSideDownPortrait Layout (both for iOS 5 and 6). This is what I understood is acceptable by the Apple app store acceptance guidelines. All is good except that I could not set only the two desired above layouts for iPad on iOS 5. It's either only the Portrait Layout or all 4 orientation layouts. I could not block just the landscape layouts and leave the other two. What do you propose? Is it alright under the app store terms?
 

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.