Create a landscape only iPad app with Phonegap

Showing 1-20 of 20 messages
Create a landscape only iPad app with Phonegap JMF 6/30/12 12:44 PM
Hello,

I have searched and searched for this but cannot find an answer. I want to create an iPad-only app with Phonegap, and I want it to only launch and run in widescreen format. I've got the HelloWorld app to run, but I can't get it to run in landscape mode at all.

In XCode, I have chosen my app to be iPad only, and I have configured the Plist file for the supported interface orientations to be Landscape with left and right home buttons. I do not have any portrait options entered, and I have deselected both portrait and upside down on the Summary tab.

Is the code to determine the orientation written somewhere within the Cordova web files? I couldn't find anything there, either. If this is the case, where might I change it and what is the appropriate code to disable portrait completely?

As a complete novice, I would appreciate any and all help on this. Thank you.

JMF
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?

Thanks.
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
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?

Thanks.
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
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 anurag gautam 7/2/12 9:41 PM
Hello 
   
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.

-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com



--
Thanks!
With regards
ANURAG GAUTAM
7814155605
Linkedin profile


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.

Noli
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.

Noli
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:

Instead of 

[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:

After

    [super viewDidLoad];

    // Do any additional setup after loading the view from its nib.

add

    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.

______________________________
Kerri Shotts
photoKandy Studios LLC

📱 Phone: +1 (312) 380-1035
🌐 Web: http://photokandy.com 

Twitter: @photokandy

-- You received this message because you are subscribed to the Google

Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.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)

-Derek
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.

Den tirsdag den 10. juli 2012 06.27.54 UTC+2 skrev Kerri Shotts:
Re: Create a landscape only iPad app with Phonegap Jeremy Marshall 9/22/12 12:01 AM
Hi

worked like a charm. This has been annoying me on and off for a long time

Thanks
Jeremy
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:

Fantastic! Thank you for your help. Just upgraded to Xcode 4.5 and was working with one of my apps when I noticed that the orientation wasn't working. Found out that it is an issue with Xcode, but couldn't find a fix. Your code did the trick. Though the app is still only rotating in three dimensions, that is good enough for me.

Sometimes, well most of the time, upgrading Xcode builds, are fraught with land mines.

Thanks to you, there is one less thing to worry about.

-Rachel

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com