|Re: Create a landscape only iPad app with Phonegap||JMF||7/2/12 11:13 AM|
At work we have Xcode 4.3.2 and PhoneGap 1.4.1. Whenever I build an app with these versions, the content rotates along with the "application wrapper". On another laptop, I am running Xcode 4.5 DP2 and PhoneGap 1.9. Any apps I build with this, the app will work landscape but the web page/content inside remains in portrait. I can't figure out what is causing this difference to occur. Is the new Xcode 4.5 incompatible with PG? Or was something changed after 1.4.1 that I need to be aware of?
|Re: Create a landscape only iPad app with Phonegap||Robert Winterbottom||7/2/12 11:42 AM|
Im not using XCode on my work machine unfortunately, Im using Notepad++, but what I have done is create a phonegap config.xml file, you can google it and find a few samples that will get you started, but the preference I have used to force landscape only is this <preference name="orientation" value="landscape" /> , place this in your config.xml and you should be good to go. Also, after creating the config.xml, place it in the same directory as your index.html file
On Saturday, June 30, 2012 3:44:11 PM UTC-4, JMF wrote:
|Re: Create a landscape only iPad app with Phonegap||JMF||7/2/12 11:59 AM|
Thanks. I did exactly as you said but when I run the app, the content remains portrait event though the app itself is landscape. I installed the older PG 1.4.1 on my laptop running Xcode 4.5 DP2 and I have the same problem. I wonder if there is something new in Xcode 4.5 that affects PG projects. The laptop is a test machine running Mountain Lion, so the current version of Xcode can't be installed onto it to test my theory.
Is placing the config.xml file inside the Xcode project sufficient or does it have to be referenced somewhere by something, and maybe that is what I am doing wrong?
|Re: Create a landscape only iPad app with Phonegap||Robert Winterbottom||7/2/12 12:06 PM|
It may be sufficent, but I think in XCode they create a www folder and that would be where you would most likely want to put it, Im kind of new to phonegap as well, been using it for two weeks. I am currently in the process of learning Objective-C because I am kind of a mac nerd but I havent tried phonegap on my mac at home, only on my work machine, which is windows, and here I place it in the root directory with my index.html, if it is not working, you can try specifying a newer version of phonegap in the config.xml using <preference name="phonegap-version" value="1.7.0" /> but I am not sure if this will work if you are building via xcode.
|Re: Create a landscape only iPad app with Phonegap||JMF||7/2/12 12:11 PM|
The only thing I am doing with Xcode is implementing the Phonegap stuff. I'm not writing any Objective C at all. I, too, am new to this stuff and am just confused why one version of Xcode does exactly as it's supposed to on one machine and the other doesn't work correctly. I'm really beginning to think that Xcode 4.5 isn't fully compatible with Phonegap 1.9 but the only way I can think to test this is to partition the laptop and reinstall 10.7 and its version of Xcode.
Thanks for the information. I wish I could find a solution.
|Re: Create a landscape only iPad app with Phonegap||Robert Winterbottom||7/2/12 1:25 PM|
It's definitely a possibility, well good luck.
|Re: Create a landscape only iPad app with Phonegap||Kerri Shotts||7/2/12 3:05 PM|
Are you testing on an iOS 6 device or targeting iOS-6? If so, I can discuss it with you, but off-list. [NDA]
|Re: Create a landscape only iPad app with Phonegap||JMF||7/2/12 6:08 PM|
|Re: [PhoneGap] Re: Create a landscape only iPad app with Phonegap||anurag gautam||7/2/12 9:41 PM|
There is an <projectname>-info.plist in your xcode under resources folder.
You have to change set Portrait (bottom home button) value under Supported interface orientations
Try an enjoy
happy coding :)
On Tue, Jul 3, 2012 at 6:38 AM, JMF <iammich...@gmail.com> wrote:
Yes, I am working on an iOS 6 device. The best way to reach me is via email: iammichaelbower[at]gmail.com. Thanks.
|Re: [PhoneGap] Re: Create a landscape only iPad app with Phonegap||JMF||7/3/12 6:07 AM|
Thanks, I've already tried this and it still doesn't work. I heard there are changes to the webkit API in iOS 6, and that might be the reason it's not functioning as expected.
|Re: [PhoneGap] Re: Create a landscape only iPad app with Phonegap||Noli Sicad||7/3/12 9:34 PM|
I think this is phonegap 1.9.0 issue with the new SDK.
Why? Since if you have iOS 6.0 ipad simulator running and drop your
index.html to the simulator, then you rotate the simulator to
landscape, the content of index.html will display landscape as well.
However, in the previous version of PhoneGap with older SDK, this thing works.
Any of you not using the new Xcode4.5 preview 2 with PhoneGap 1.9.0?
Please try to see if this issue is not present i.e. working landscape
mode with your iPad project.
|Re: [PhoneGap] Re: Create a landscape only iPad app with Phonegap||Noli Sicad||7/5/12 11:03 PM|
It is not PhoneGap 1.9.0 for iOS that has the problem.
It is iOS 6.0 SDK with media query CSS and PhoneGap 1.9.0.
I manage to include iOS 5.0 SDK in Xcode 4.5 preview 2 and run
properly PG 1.9.0 with content rotation.
|Re: [PhoneGap] Re: Create a landscape only iPad app with Phonegap||Kerri Shotts||7/9/12 9:27 PM|
I have a solution that works on my devices, so I'd like to toss it out there for others to try. It seems to behave as one would expect on iOS 5 and 6.
Part of the problem is that the MainViewController is not set to be the rootViewController in AppDelegate.m. This should have clued me in when I saw messages from the console indicating that there wasn't a root controller, but it didn't quite click. Once I looked closer, I made the following change to AppDelegate.m:
[self.window addSubview:self.viewController.view];replace it with
self.window.rootViewController = self.viewController;At this point orientation is handled correctly, but for one problem: the webview doesn't appear to know the dimensions of the status bar, and tries to display content underneath it. I tried all sorts of things, and finally got this to work, in viewDidLoad: of MainViewController.m:
// Do any additional setup after loading the view from its nib.
self.webView.frame = CGRectMake ( 0, 20, self.view.frame.size.width, self.view.frame.size.height-20);
This is, of course, horrible, since I'm making the assumption that the status bar is present and also 20px high, but for my app it is, so I'm not bothering with the check. It seems to work fine on the simulator and device in iOS 5 and 6, though there's got to be a better way to handle the frame of the webview.
If you wouldn't mind giving it a go, I'd love to hear if it works for you or if it blows up... Something inside me says this is too easy!
|Re: [PhoneGap] Re: Create a landscape only iPad app with Phonegap||JMF||7/11/12 7:45 AM|
Thanks, I will give this a try once I get the chance. If I don't care about the status bar being visible (in the app I am working on I don't want it present anyway) do I need to worry about your "fix"? If all I do is the first part, would I be good to go?
I'm sorry I don't understand the tech stuff as much. I'm better with the web stuff and have no knowledge of XCode or Obj C, so it's all confusing to me.
Thanks very much for posting this. I can't wait to try it and see how I fare.
|Re: [PhoneGap] Re: Create a landscape only iPad app with Phonegap||Kerri Shotts||7/11/12 8:17 PM|
If your status bar is invisible, then yes, you only need to worry about the first part -- the view will then fill the entire screen. In my case, I wanted the status bar to be displayed (and not translucent), so I had to add the 20px to get the view to resize correctly.
photoKandy Studios LLC
📱 Phone: +1 (312) 380-1035
🌐 Web: http://photokandy.com
|Re: [PhoneGap] Re: Create a landscape only iPad app with Phonegap||Phonegappin||9/20/12 4:53 PM|
This saved me a lot of headaches. Thank you for posting this solution!
My iPad landscape only app was suddenly coming up with the view laying on it's side. (portrait view while the pad was landscape)
|Re: [PhoneGap] Re: Create a landscape only iPad app with Phonegap||Michael Falck Wedelgård||9/21/12 12:38 PM|
Thank you!!!! This worked like a charm.
|Re: [PhoneGap] Re: Create a landscape only iPad app with Phonegap||Abhi||9/30/12 7:38 PM|
iPad apps supposed to be usable in both orientations as per Apple user interface guidelines. Keynote app does not all though
Sent from my iPhone
On 1 Oct, 2012, at 7:10 AM, "Rachel_:-)" <teddys...@gmail.com> wrote: