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