0

我正在根据摄影要求制作摄影应用程序,我必须在menner中显示所有进度或活动指示器才能看起来像打开相机快门。想要获得像在iphone中打开相机快门的动画

为了更好的解释,请参阅附加图像。

enter image description here

如在图像中显示而装载关闭照相机的快门应旋转,并且后加载消息应该来打开相机快门后。

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

编辑:我有一个代码This Question。我已经使用这样的代码这样的

-(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"]; 

} 

但它给了我方形动画我想这个动画圆形。见附图。

enter image description here

我想给圆角半径到这一层像

[[[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]]; 

但这个代码dosent工作.... 请指导我如何使这个动画圆形。

回答

3

为了让您的SQUARE的UIImageView圆形:

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

感谢它的工作.. –

+0

请告诉我,我怎样才能改变快门的颜色。默认情况下它是深灰色 –

+0

我不知道..不认为这是可能的。如果你真的需要“颜色”,你可以在快门上方添加一个UIView。然后,将UIView背景色设置为RED,然后调整UIView的Alpha值,以便在快门上获得红色色调。 :) – Geoffroy