当我选择一个图像时,我想要一个从拾取器到主视图(这是模糊区域)的动画,有人有个好主意吗?
答案 0 :(得分:0)
基本理念:
您必须使用 - (CGRect)convertRect:(CGRect)rect fromView:(UIView *)视图进行一些计算 不确定,但是Picker可能位于与蓝色区域不同的窗口中。
CGRect destRect; // position in window, height/width need to be flipped, so the size is correct after rotation
// add a ContainerView so rotation-handling is easier, esp. durring moving/scaling
UIView *containerView = [[UIView alloc] initWithFrame:destRect];
// set the frame of the imageView, origin 0/0 so rotation is easy to handle, height/width flipp back
UIImageView *tempImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, destRect.size.height, destRect.size.width)];
// flip layer center as well
[tempImageView setCenter:CGPointMake(camView.center.y, camView.center.x)];
// add the rotation
[tempImageView setTransform:CGAffineTransformMakeRotation(M_PI_2)];
[tempImageView setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];