Re: iphone landscape problems
Re: iphone landscape problems
- Subject: Re: iphone landscape problems
- From: Memo Akten <email@hidden>
- Date: Wed, 18 Feb 2009 23:47:28 +0000
I've identified the problem for the first scenario (view appearing
portrait then rotating).
I have a function [MyViewController show] and [MyViewController hide]
which transition the view in and out:
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:ANIMATION_TIME];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown
forView:window cache:YES];
[UIView setAnimationCurve: ANIMATION_CURVE];
[self viewWillAppear:YES];
[window addSubview:self.view];
[self viewDidAppear:YES];
[UIView commitAnimations];
I wasn't adding the view directly but was doing a transition. So
instead of appearing with a transition directly in landscape it was
transitioning in portrait, then rotating into landscape. After that
when i trigger the show / hide it transitions in correctly in
landscape. I guess this is a bug? I found two workarounds, I can
either not transition it in when it first appears. Or create another
viewcontroller with an empty view, add that to the window, and then
add the animated view controller to that. It seems a bit unnessecary
as there is an empty view on top of the window which contains my main
view.
Memo (Mehmet S. Akten)
www.memo.tv
www.twitter.com/memotv
www.vimeo.com/memotv
On 18 Feb 2009, at 19:46, Memo Akten wrote:
Hi Thanks for the response. I was building for 2.2.
I am now trying for 2.2.1 and getting the exact same behavior.
Regarding the 2nd point, if I use UIActionSheet it works correctly,
but UIAlertView does not orient.
A bit of info about my setup.
- I create window manually in applicationDidFinishLaunching
- I create a EAGLView (based on the apple sample) and attach that
directly to window
- I have a rootViewController and a bunch of other controllers and
views which get attached to the rootViewController. And I attach the
rootViewController.view to window
- the rootViewController returns YES for only landscape orientations
- so there are 2 views in my window. glView, and rootViewController
on top. The latter is only visible when menu is activated.
Could this be why I'm having the problem? Should I set it up
differently ?
Memo (Mehmet S. Akten)
www.memo.tv
www.twitter.com/memotv
www.vimeo.com/memotv
On 18 Feb 2009, at 19:25, Robert Marini wrote:
In my applicationDidFinishLaunching I have:
[[UIApplication sharedApplication] setStatusBarOrientation:
UIInterfaceOrientationLandscapeRight animated:NO];
Out of curiosity, what version of iPhone OS are you building for?
If you're using 2.1 and later, it should just work. If not, you'll
need to do something like this as well (I typed this in Mail so
there may be blood...err...typos).
CGAffineTransform transform = self.view.transform
CGRect statusBarFrame = [[UIApplication sharedApplication]
statusBarFrame];
CGRect bounds = CGRectMake(0, 0, statusBarFrame.size.height,
statusBarFrame.origin.x);
CGPoint centerPoint = CGPointMake(bounds.size.height / 2.0,
bounds.size.width / 2.0);
self.view.center = centerPoint;
transform = CGAffineTransformRotate (transform, (M_PI / 2.0));
self.view.transform = transform.
and then...
[window makeKeyAndVisible];
(otherwise the window will show and then rotate in a rather harsh
fasion that the user would see)
2. when i create and show a UIAlertView it appears in portrait,
even if I am holding my iphone in landscape and the views are in
landscape. Is there no way to fix this?
If you've set your status bar orientation in
applicationDidFinishLaunching and your view controllers are
properly set up (overriding shouldAutorotateToInterfaceOrientation,
etc) this should behave normally. If you could build for 2.2.1 and
have verified that this is the case, please file a bug report. In
the meantime one possible workaround is to rotate the view after
it's been displayed in didPresentAlertView (though I've not heard
of this since the 2.0 betas so I would double check my view
controller related code).
-rob.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden