Ios 想要在iphone中打开相机快门这样的动画吗

Ios 想要在iphone中打开相机快门这样的动画吗,ios,uiimageview,uiviewanimation,uiactivityindicatorview,caanimation,Ios,Uiimageview,Uiviewanimation,Uiactivityindicatorview,Caanimation,我正在根据要求制作一个基于摄影的应用程序,我必须在一个菜单中显示所有进度或活动指示器,看起来就像打开相机快门一样 如需更好的解释,请参阅所附图片 如图所示,当加载时,相机的关闭快门应旋转,加载后信息应在打开相机快门后出现 请告诉我如何实现这种动画 编辑:我从你那里得到一个密码。我用过这样的代码 -(void)shutter { CATransition *shutterAnimation = [CATransition animation]; [shutterAnimation

我正在根据要求制作一个基于摄影的应用程序,我必须在一个菜单中显示所有进度或活动指示器,看起来就像打开相机快门一样

如需更好的解释,请参阅所附图片

如图所示,当加载时,相机的关闭快门应旋转,加载后信息应在打开相机快门后出现

请告诉我如何实现这种动画

编辑:我从你那里得到一个密码。我用过这样的代码

-(void)shutter
{
    CATransition *shutterAnimation = [CATransition animation];
    [shutterAnimation setDelegate:self];
    [shutterAnimation setDuration:1.5];
    shutterAnimation.timingFunction = UIViewAnimationCurveEaseInOut;
    [shutterAnimation setType:@"cameraIris"];
    [shutterAnimation setValue:@"cameraIris" forKey:@"cameraIris"];
    [shutterAnimation setRepeatDuration:4.5];
    [[[self.view viewWithTag:90] layer] addAnimation:shutterAnimation forKey:@"cameraIris"];

}
但它给了我方形的动画,我想要圆形的动画。请参阅所附图片

我试着给这个层赋予角半径,就像

[[[self.view viewWithTag:90] layer] setCornerRadius:75.0];//size of this view is 150X150 so i give radius 75 to make it round.
[[[self.view viewWithTag:90] layer] setBorderWidth:2.0];
[[[self.view viewWithTag:90] layer] setBorderColor:[[UIColor blackColor] CGColor]];
但是这个代码不起作用。。。。
请指导我如何将此动画制作成圆形。

要将方形UIImageView制作成圆形:

CALayer *imageViewLayer = [imageView layer];
[imageViewLayer setMasksToBounds:YES];
[imageViewLayer setCornerRadius:imageView.frame.size.height/2];

要使方形UIImageView成为圆形,请执行以下操作:

CALayer *imageViewLayer = [imageView layer];
[imageViewLayer setMasksToBounds:YES];
[imageViewLayer setCornerRadius:imageView.frame.size.height/2];

请告诉我如何更改快门的颜色。默认为深灰色我不知道。。我认为这是不可能的。如果你真的需要一个“颜色”,你可以在快门上方添加一个UIView。然后将UIView背景色设置为红色,例如,调整UIView的alpha值,以便在快门上获得红色色调。:)谢谢你的快速回复。我试过了,这是我的代码<代码>[vv setBackgroundColor:[UIColor redColor]]
[vv setAlpha:1.0]
[[self.view view with tag:90]addSubview:vv]但它不起作用-什么不起作用?试试这个:
CGRect frame=CGRectMake(yourShutterX,yourShutterY,yourShutterW,yourShutterH);UIView*子视图=[[UIView alloc]initWithFrame:frame];subView.backgroundColor=[UIColor redColor];sebView.setAlpha=0.5;[self.view addSubview:subView]请告知我如何更改快门的颜色。默认为深灰色我不知道。。我认为这是不可能的。如果你真的需要一个“颜色”,你可以在快门上方添加一个UIView。然后将UIView背景色设置为红色,例如,调整UIView的alpha值,以便在快门上获得红色色调。:)谢谢你的快速回复。我试过了,这是我的代码<代码>[vv setBackgroundColor:[UIColor redColor]]
[vv setAlpha:1.0]
[[self.view view with tag:90]addSubview:vv]但它不起作用-什么不起作用?试试这个:
CGRect frame=CGRectMake(yourShutterX,yourShutterY,yourShutterW,yourShutterH);UIView*子视图=[[UIView alloc]initWithFrame:frame];subView.backgroundColor=[UIColor redColor];sebView.setAlpha=0.5;[self.view addSubview:subView]