Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 8    Views: 107

OrchardApps
Code is Art
Profile
Posts: 115
Reg: Jan 11, 2012
Brisbane austra...
5,850
06/02/13 03:20 PM (12 years ago)

XIB menu plugin auto rotation ipad not working

Hello, I have implemented the XIB menu plugin (awesome) into my project. I have applied two different backgrounds - 1 in the ipad portrait view, 1 in the ipad landscape view. If I open the ipad in portrait the correct view displays. If i open the ipad in landscape the correct view displays. However - Once the screen has loaded if I change orientation from portrait to landscape or landscape to portrait the view does not change. It does not seem to change dynamically once the app is in use Any help will be greatly appreciated. Christine
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/03/13 02:06 AM (12 years ago)
Well.... I dunno, I don't have that plugin, lol! Mutzy would be the one to ask, but in the interim... Check and see if the plugin has a 'layoutScreen' method. This detects when the device changes orientation after the plugin has loaded. it should look something like this: -(void) layoutScreen { if(UIDeviceOrientationIsPortrait) { do something to correct the orientation } else { // else it's landscape do something to correct the orientation } } if the method exists, you might want to add some code to reload the portrait or landscape view. If it's not there, then you may want to add it. Hope this helps! Cheers! -- Smug
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
06/03/13 02:33 AM (12 years ago)
 
OrchardApps
Code is Art
Profile
Posts: 115
Reg: Jan 11, 2012
Brisbane austra...
5,850
like
06/04/13 06:52 PM (12 years ago)
@madrod. Thanks - I have implemented the suggestions on that thread, but I'm having a slightly different issue. @SumgWimp Thanks - there isn't a 'layoutScreen' method so I'll dig deeper. Thanks for the pointer. Chris
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
06/07/13 03:21 PM (12 years ago)
Chris- SORRY FOR THE DELAY!!! I just finished 6 straight 12 hour overnight shifts in the ER and have been a zombie all week. Now, you're saying it loads in the correct orientation but then doesn't switch views when you rotate between landscape and portrait? That's odd. You're the first person to report a problem like this. Okay, lets try some things. 1. It looks as if you implemented the change that Kittsy suggested in the below link, yes? Were you having the problem before you made that change? If so move on... https://www.buzztouch.com/forum/thread.php?fid=1395920398779DB4B755A76&tid=1395920398779DB4B755A76 2. The code that helps the screen rotate in the jm_Xib_button_menu.m file is near the very end and looks like the following: -(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{ [BT_debugger showIt:self theMessage:@"willRotateToInterfaceOrientation"]; if(UIInterfaceOrientationIsLandscape(toInterfaceOrientation)){ self.view = iPadLandscape; }else{ self.view = iPadPortrait; } } Is that what it looks like your in file too? If not that could be the problem. 3. In Xcode when you when you click on your app's target and go to summary, then scroll down to the iPad deployment info section... do you have all interface orientations selected? If not, select them all. 4. Lastly, in your appDelegate.m file, scroll to the very bottom until you see the following: //UNCOMMENT THIS TO SUPPORT iOS 6 SCREEN ROTATAIONS mask |= UIInterfaceOrientationMaskPortrait; if(canRotate){ mask |= UIInterfaceOrientationMaskLandscapeLeft; mask |= UIInterfaceOrientationMaskLandscapeRight; mask |= UIInterfaceOrientationMaskPortraitUpsideDown; } return mask; Make sure you have the "//" in front of "uncomment" to allow rotations to work. ANY LUCK?? Josh
 
OrchardApps
Code is Art
Profile
Posts: 115
Reg: Jan 11, 2012
Brisbane austra...
5,850
like
06/11/13 04:18 AM (12 years ago)
Hi Josh, Thanks for getting back to me. I had put this down for a few days in frustration and my buzztouch email notifications aren't working. Everything looks as it should. I have the mask code, although it doesn't show "//UNCOMMENT THIS TO SUPPORT iOS 6 SCREEN ROTATAIONS" before hand. So perhaps it's been updated by default? I have implemented the code from Kitsy into the jm_Xib_button_menu.m file as specified. I am wondering if it's a version thing? I am running Xcode 4.6.2, IOS SDK 6.1 I created a test app with nothing else in it, but the xib menu and the same thing happens. Have you tried it recently? Is it possible that there has been an update that has screwed things up a bit? I'm at a complete loss. Thanks for your help. Chris PS - has anyone ever told you that you work too hard!
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
06/11/13 06:43 PM (12 years ago)
I have Xcode 4.6 and iOS SDK 6.1. I will play around with it in a new app when I get some time off. In the meantime try adding the //UNCOMMENT THIS TO SUPPORT iOS 6 SCREEN ROTATAIONS before that section to see if it changes anything. Josh
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
06/27/13 10:25 AM (12 years ago)
Hey, I'm having the same problem? Any more suggestions? Thanks Miguel
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
07/18/13 05:55 AM (12 years ago)
Hey, so THE MAN, Kittsy, solved me this problem as well. BT_tabBarController.m comment out lines 112 to 138 It works great. Thanks Cheers Miguel
 

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.