I'm working on an app that is in landscapeleft mode most of the time. I need to be able to pick an image but even after subclassing the imagepickercontroller and returning yes for the -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) toInterfaceOrientation when the orientation is landscape the imagePicker is displayed in portrait. I have attempted to maunally rotate the view but I get unpredictable image selection results. This is my rotation code:

-(void)rotateView:(UIView*)theView
{
        [[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];

        [UIView beginAnimations:@"View Flip" context:nil];
        [UIView setAnimationDuration:.5];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        
        [[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
        if (self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
                theView.transform = CGAffineTransformIdentity;
theView.transform = CGAffineTransformMakeRotation (degreesToRadian(270));
                theView.bounds = CGRectMake(0.0, 0.0, 480, 320);
        }
        
        theView.center = CGPointMake(160.0f, 240.0f);
        [UIView commitAnimations];
}
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to