开发者

iPhone UIView frame animation inconsistent why?

开发者 https://www.devze.com 2022-12-26 12:08 出处:网络
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 nex

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 shrink开发者_开发百科s 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?

0

精彩评论

暂无评论...
验证码 换一张
取 消