iPhone UIView frame animation inconsistent why?

Posted by Rick on Stack Overflow See other posts from Stack Overflow or by Rick
Published on 2010-04-09T12:21:31Z Indexed on 2010/04/09 12:23 UTC
Read the original article Hit count: 459

Filed under:
|
|

I have an app that uses an image loaded in from an UIImagePickerController instance. Once the picker is dismissed so as to reduce the jarring transition from the picker layout to the layout of the next function I initially have the UIImageView for the image fill the whole screen and then when the picker is dismissed the image 'squeezes' up to the top left of the screen.

from the initWithFrame...

targetPicView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 480.0)];
[targetPicView setContentMode:UIViewContentModeScaleToFill];

this in a function called after dismissing the picker...

[UIView beginAnimations:@"squeeze" context:context];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];
[targetPicView setFrame:CGRectMake(20.0, 20.0, 130.0, 150.0)];
[UIView commitAnimations];

The weird thing is that this works great when the image has been chosen from the library, the view shrinks down with the top left corner in place just as I planned but... If the image comes from the camera then the view shrinks with the top right corner in place instead and appears to come in from the left side of the screen.

Can anyone shed any light on this?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiview