Orientation Not Getting Changed

101 views
Skip to first unread message

Code Generator

unread,
Sep 23, 2008, 7:25:06 AM9/23/08
to phonegap
Hi Folks
i have integrate my application with phoneGap but facing few issues

1- When i rotate the simulator it doesn't rotate my application
is there any1 fixed the orientation issue?

2- no keyboard shown or visible when focus on any text field

I will appreciate your earliest response


~cheers

Dirk Holtwick

unread,
Sep 23, 2008, 7:50:26 AM9/23/08
to phon...@googlegroups.com
Hi,

I solved these problems in my Big 5 app. I created a private group on
Google Groups and I will try to release the code within the next hours
there. To get updated you might want to enter this private group:

http://groups.google.de/group/big5apps

For more informations about this project go here:

http://www.big5apps.com/

Dirk

Code Generator schrieb:

kazoomer

unread,
Sep 23, 2008, 9:16:17 AM9/23/08
to phonegap
Keyboard support was fixed last week and orientation will be added
very shortly via a settings bundle.
Make sure you have the latest code from github. If you need any help,
just let us know.

Rob

Faisal siddiqui

unread,
Sep 24, 2008, 3:00:29 AM9/24/08
to phon...@googlegroups.com
hey thanks buddy
I have got the keyboard changes.. i found the a way to implement rotation here

Let's say you wanted the UIWebView to AutoRotate. You would add:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; }
and then in LoadView you would add: self.view.autoresizesSubviews = YES; self.view.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);

but unfortunately i am unable to understand where should i add these methods.

I would love to work on PhoneGap 100% if you want me ..

again thanks for the prompt reply

~cheers
--
Faisal Ahmed Siddiqui
Project Manager/Architect
Netpace

Ricky

unread,
Nov 20, 2008, 9:49:22 PM11/20/08
to phonegap
Thank you for this hint. For anyone else who checks, I have found
where to add these:
In Classes/GlassViewController.h before @end:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)
interfaceOrientation;

In Classes/GlassViewController.m before @end:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)
interfaceOrientation
{
return YES;
}

With those changes, it should rotate.


On Sep 23, 11:00 pm, "Faisal siddiqui" <faysal.siddi...@gmail.com>
wrote:

Jake Wolpert

unread,
Nov 21, 2008, 12:56:37 AM11/21/08
to phon...@googlegroups.com
that's half the job, the JavaScript inside the webview never knows it's been rotated! 
----
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ 
http://jpassoc.com/x   on your iPhone!

Jeff McFadden

unread,
Nov 21, 2008, 12:52:36 PM11/21/08
to phonegap
Jake,

I haven't tried this, so maybe it doesn't work. But does changing the
orientation kick off a window.resize event? Seems like it should given
that the size has just changed a lot. Might be worth checking the
webapps docs to see if there are any tips on this for non-gap
applications (just safari) that might work for us.

Or maybe it just doesn't do anything and you can't tell without
checking constantly, which is no good.

-- Jeff

On Nov 20, 10:56 pm, Jake Wolpert <jakeci...@gmail.com> wrote:
> that's half the job, the JavaScript inside the webview never knows  
> it's been rotated!
> ----
> Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬhttp://jpassoc.com/x  on your iPhone!

Jake Wolpert

unread,
Nov 21, 2008, 2:38:01 PM11/21/08
to phon...@googlegroups.com
I'm working on it, so far I have this code, but it doesn't work.
#import "GlassViewController.h"
#import "GlassAppDelegate.h"

@implementation GlassViewController

// Subclasses override this method to define how the view they control will respond to device rotation 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
//UIInterfaceOrientationPortrait           = UIDeviceOrientationPortrait,
    //UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
    //UIInterfaceOrientationLandscapeLeft      = UIDeviceOrientationLandscapeRight,
    //UIInterfaceOrientationLandscapeRight     = UIDeviceOrientationLandscapeLeft
double i = 0;
NSString * jsCallBack = nil;
NSString * ret = nil;
switch (toInterfaceOrientation){
case UIInterfaceOrientationPortrait:
NSLog(@"UIInterfaceOrientationPortrait");
i = 0;
break;
case UIInterfaceOrientationPortraitUpsideDown:
NSLog(@"UIInterfaceOrientationPortraitUpsideDown");
i = 180;
break;
case UIInterfaceOrientationLandscapeLeft:
NSLog(@"UIInterfaceOrientationLandscapeLeft");
i = 90;
break;
case UIInterfaceOrientationLandscapeRight:
NSLog(@"UIInterfaceOrientationLandscapeRight");
i = -90;
break;
default:
NSLog(@"default");
}
NSLog(@"%f",duration);
GlassAppDelegate *appDelegate = (GlassAppDelegate*)[[UIApplication sharedApplication] delegate];
jsCallBack = [[NSString alloc] initWithFormat:@"window.orientation = %f;window.onorientationchange();", i];
ret = [appDelegate.webView jsCallBack];
NSLog(jsCallBack);
NSLog(ret);
}
- (IBAction)loadView {

    

}

- (IBAction)pushBack {

    

}

- (IBAction)pushHome {

    

}
@end

----
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ 
http://jpassoc.com/x   on your iPhone!

Jake Wolpert

unread,
Nov 21, 2008, 2:42:09 PM11/21/08
to phon...@googlegroups.com

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---



Reply all
Reply to author
Forward
0 new messages