I have searched for hours for the answer to my question and have found nothing that seems to work. So please accept my apologies if this question has already been answered…
I am very new to app development and have been suggested to go down the route of html, css, jquery using XCODE and PhoneGap to build and compile.
After a lot of faffing, I’ve managed to build a html page and test it through XCODE.
My issue is I can not force the orientation to landscape.
I found answers to set the orientation in the .plist file which I have done. This changes the orientation of toolbars and viewing window, but the content (HTML) stays in portrait mode.
I found an example post where someone created a test app in landscape mode only, great I thought, but unfortunately this was in objective C.
For example this is in a file called ViewA.m
// ViewA.m
#import "ViewA.h"
@implementation ViewA
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
-(void)viewDidLoad
{
// self.view.frame = CGRectMake(0.0, 0.0, 1024.0, 768.0);
[super viewDidLoad];
}
@end
Do these separate files work for HTML as well as Objective C?
Is there a jquery/javascript solution for html apps?
I appreciate this is a bit of a “bitty” question and there could be multiple answers. I would appreciate any help or direction someone could offer.
If this has been solved already, as I say sorry for a repeat question, but there are so many of similar questions, it’s very hard to get through them all!
Thanks in advance!
I’ve noticed a few people have looked. I’ve managed to find the answer to my question and wanted to post it, just incase anyone else is having a similar issue.
To get the content of an app written in HTML to appear in landscape mode you need to go (in xcode)
Folder (app name) -> Classes -> MainViewController.m
You will see:
Change this to
And that should work 🙂